Moti Asayag has uploaded a new change for review.

Change subject: engine: Add error message for wrong host provider type
......................................................................

engine: Add error message for wrong host provider type

The existing error message for mismatch provider type
is explicit for openstack networking. Hence there is
a need for host provider (Foreman) as well.

Change-Id: I318558161b06c1fab8d3ceb54d987f34a719b643
Signed-off-by: Moti Asayag <masa...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/UpdateHostValidator.java
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/UpdateHostValidatorTest.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
M 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
M 
frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
6 files changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/07/37607/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/UpdateHostValidator.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/UpdateHostValidator.java
index 080a29f..88e6f7b 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/UpdateHostValidator.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/UpdateHostValidator.java
@@ -106,7 +106,7 @@
     }
 
     public ValidationResult hostProviderTypeMatches() {
-        return 
ValidationResult.failWith(VdcBllMessages.ACTION_TYPE_FAILED_PROVIDER_TYPE_MISMATCH)
+        return 
ValidationResult.failWith(VdcBllMessages.ACTION_TYPE_FAILED_HOST_PROVIDER_TYPE_MISMATCH)
                 .when(getProvider() != null && getProvider().getType() != 
ProviderType.FOREMAN);
     }
 
diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/UpdateHostValidatorTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/UpdateHostValidatorTest.java
index cf85dce..2b7d381 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/UpdateHostValidatorTest.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/UpdateHostValidatorTest.java
@@ -355,7 +355,7 @@
         validator = new UpdateHostValidator(dbFacade, oldHost, host, false);
 
         assertThat(validator.hostProviderTypeMatches(),
-                
failsWith(VdcBllMessages.ACTION_TYPE_FAILED_PROVIDER_TYPE_MISMATCH));
+                
failsWith(VdcBllMessages.ACTION_TYPE_FAILED_HOST_PROVIDER_TYPE_MISMATCH));
     }
 
     private String generateRandomName() {
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
index 23f10ba..d53f5b9 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
@@ -590,6 +590,7 @@
     
ACTION_TYPE_FAILED_EXTERNAL_NETWORK_WITH_VLAN_MUST_BE_LABELED(ErrorType.BAD_PARAMETERS),
     
ACTION_TYPE_FAILED_ISCSI_BOND_NETWORK_CANNOT_BE_REQUIRED(ErrorType.NOT_SUPPORTED),
     ACTION_TYPE_FAILED_PROVIDER_TYPE_MISMATCH(ErrorType.BAD_PARAMETERS),
+    ACTION_TYPE_FAILED_HOST_PROVIDER_TYPE_MISMATCH(ErrorType.BAD_PARAMETERS),
     ACTION_TYPE_FAILED_MISSING_NETWORK_MAPPINGS(ErrorType.BAD_PARAMETERS),
     ACTION_TYPE_FAILED_MISSING_MESSAGING_BROKER_PROPERTIES(ErrorType.CONFLICT),
     ACTION_TYPE_FAILED_PROVIDER_NETWORKS_USED_ONCE(ErrorType.CONFLICT),
diff --git 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
index 2a57c80..c5f5a73 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
@@ -615,6 +615,7 @@
 ACTION_TYPE_FAILED_MIGRATION_NETWORK_IS_NOT_SUPPORTED=Cannot ${action} 
${type}. Migration network is not supported for this cluster version.
 ACTION_TYPE_FAILED_PROVIDER_DOESNT_EXIST=Cannot ${action} ${type}. The 
provider does not exist in the system.
 ACTION_TYPE_FAILED_PROVIDER_TYPE_MISMATCH=Cannot ${action} ${type}. The 
provider type should be 'OpenStack Networking'.
+ACTION_TYPE_FAILED_HOST_PROVIDER_TYPE_MISMATCH=Cannot ${action} ${type}. The 
provider type should be 'External Host Provider (Foreman)'.
 ACTION_TYPE_FAILED_MISSING_NETWORK_MAPPINGS=Cannot ${action} ${type}. The 
network mappings should be provided as a parameter or configured on the network 
provider.
 ACTION_TYPE_FAILED_MISSING_MESSAGING_BROKER_PROPERTIES=Cannot ${action} 
${type}. The network provider's broker host address must be configured on the 
provider.
 ACTION_TYPE_FAILED_PROVIDER_NETWORKS_USED_MULTIPLE_TIMES=Cannot ${action} 
${type}. Several external networks (${NETWORK_NAMES_COUNTER}) are being used by 
virtual machines and/or templates:\n${NETWORK_NAMES}\n - Please resolve the 
external networks usage first and try again.
diff --git 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
index bef35a1..30acfd6 100644
--- 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
+++ 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
@@ -1687,6 +1687,9 @@
     @DefaultStringValue("Cannot ${action} ${type}. The provider type should be 
'OpenStack Networking'.")
     String ACTION_TYPE_FAILED_PROVIDER_TYPE_MISMATCH();
 
+    @DefaultStringValue("Cannot ${action} ${type}. The provider type should be 
'External Host Provider (Foreman)'.)
+    String ACTION_TYPE_FAILED_HOST_PROVIDER_TYPE_MISMATCH();
+
     @DefaultStringValue("Cannot ${action} ${type}. The network provider's 
broker host address must be configured on the provider.")
     String ACTION_TYPE_FAILED_MISSING_NETWORK_MAPPINGS();
 
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
index cd7f823..d3d36fc 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
+++ 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
@@ -619,6 +619,7 @@
 ACTION_TYPE_FAILED_MIGRATION_NETWORK_IS_NOT_SUPPORTED=Cannot ${action} 
${type}. Migration network is not supported for this cluster version.
 ACTION_TYPE_FAILED_PROVIDER_DOESNT_EXIST=Cannot ${action} ${type}. The 
provider does not exist in the system.
 ACTION_TYPE_FAILED_PROVIDER_TYPE_MISMATCH=Cannot ${action} ${type}. The 
provider type should be 'OpenStack Networking'.
+ACTION_TYPE_FAILED_HOST_PROVIDER_TYPE_MISMATCH=Cannot ${action} ${type}. The 
provider type should be 'External Host Provider (Foreman)'.
 ACTION_TYPE_FAILED_MISSING_NETWORK_MAPPINGS=Cannot ${action} ${type}. The 
network mappings should be provided as a parameter or configured on the network 
provider.
 ACTION_TYPE_FAILED_MISSING_MESSAGING_BROKER_PROPERTIES=Cannot ${action} 
${type}. The network provider's broker host address must be configured on the 
provider.
 ACTION_TYPE_FAILED_PROVIDER_NETWORKS_USED_MULTIPLE_TIMES=Cannot ${action} 
${type}. Several external networks (${NETWORK_NAMES_COUNTER}) are being used by 
virtual machines and/or templates:\n${NETWORK_NAMES}\n - Please resolve the 
external networks usage first and try again.


-- 
To view, visit http://gerrit.ovirt.org/37607
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I318558161b06c1fab8d3ceb54d987f34a719b643
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Moti Asayag <masa...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to