Martin Mucha has uploaded a new change for review.

Change subject: core,webadmin: enforce that label cannot be added to external 
network short summary under 50 chars
......................................................................

core,webadmin: enforce that label cannot be added to external network
short summary under 50 chars

Longer description using lines' length under 72 chars.

With multiple paragraphs if necessary.

Change-Id: I1c697a06afa15ff5c31c0396d0744c9c456c2dc9
Bug-Url: https://bugzilla.redhat.com/1140491
Signed-off-by: Martin Mucha <mmu...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/dc/LabelNetworkCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/NetworkValidator.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/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
5 files changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/25/32825/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/dc/LabelNetworkCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/dc/LabelNetworkCommand.java
index 8492803..fca87d7 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/dc/LabelNetworkCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/dc/LabelNetworkCommand.java
@@ -49,7 +49,8 @@
     protected boolean canDoAction() {
         NetworkValidator validator = new NetworkValidator(getNetwork());
         return validate(validator.networkIsSet())
-                && validate(validator.notLabeled());
+                && validate(validator.notLabeled())
+                && validate(validator.notExternalNetwork());
     }
 
     @Override
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/NetworkValidator.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/NetworkValidator.java
index 2a7238b..c6e4783 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/NetworkValidator.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/NetworkValidator.java
@@ -205,6 +205,11 @@
                 .when(NetworkUtils.isLabeled(network));
     }
 
+    public ValidationResult notExternalNetwork() {
+        return 
ValidationResult.failWith(VdcBllMessages.ACTION_TYPE_FAILED_NOT_SUPPORTED_FOR_EXTERNAL_NETWORK)
+                .when(network.isExternal());
+    }
+
     protected List<VM> getVms() {
         if (vms == null) {
             vms = getDbFacade().getVmDao().getAllForNetwork(network.getId());
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 f95ca61..e714829 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
@@ -557,6 +557,7 @@
     
ACTION_TYPE_FAILED_EXTERNAL_NETWORK_DETAILS_CANNOT_BE_EDITED(ErrorType.NOT_SUPPORTED),
     
ACTION_TYPE_FAILED_EXTERNAL_NETWORK_MUST_BE_VM_NETWORK(ErrorType.BAD_PARAMETERS),
     ACTION_TYPE_FAILED_EXTERNAL_NETWORK_NOT_SUPPORTED(ErrorType.NOT_SUPPORTED),
+    
ACTION_TYPE_FAILED_NOT_SUPPORTED_FOR_EXTERNAL_NETWORK(ErrorType.NOT_SUPPORTED),
     
ACTION_TYPE_FAILED_EXTERNAL_NETWORK_CANNOT_BE_DISPLAY(ErrorType.NOT_SUPPORTED),
     
ACTION_TYPE_FAILED_EXTERNAL_NETWORK_CANNOT_BE_REQUIRED(ErrorType.NOT_SUPPORTED),
     
ACTION_TYPE_FAILED_EXTERNAL_NETWORK_WITH_VLAN_MUST_BE_LABELED(ErrorType.BAD_PARAMETERS),
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 7103806..f4142ed 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
@@ -608,6 +608,7 @@
 ACTION_TYPE_FAILED_EXTERNAL_NETWORK_MUST_BE_VM_NETWORK=Cannot ${action} 
${type}. An external network cannot be a non-VM network.
 ACTION_TYPE_FAILED_EXTERNAL_NETWORK_DETAILS_CANNOT_BE_EDITED=Cannot ${action} 
${type}. External network details (except name and description) cannot be 
changed.
 ACTION_TYPE_FAILED_EXTERNAL_NETWORK_NOT_SUPPORTED=Cannot ${action} ${type}. 
External networks are not supported for this cluster's compatibility version.
+ACTION_TYPE_FAILED_NOT_SUPPORTED_FOR_EXTERNAL_NETWORK=Cannot ${action} 
${type}. This operation is not supported for external networks.
 ACTION_TYPE_FAILED_EXTERNAL_NETWORK_CANNOT_BE_DISPLAY=Cannot ${action} 
${type}. External network cannot be used as a display network.
 ACTION_TYPE_FAILED_EXTERNAL_NETWORK_CANNOT_BE_REQUIRED=Cannot ${action} 
${type}. External network cannot be set as required in the cluster.
 ACTION_TYPE_FAILED_EXTERNAL_NETWORK_WITH_VLAN_MUST_BE_LABELED=Cannot ${action} 
${type}. External network with vlan must be labeled.
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 29ee2ac..d022e4d 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
@@ -611,6 +611,7 @@
 ACTION_TYPE_FAILED_EXTERNAL_NETWORK_MUST_BE_VM_NETWORK=Cannot ${action} 
${type}. An external network cannot be a non-VM network.
 ACTION_TYPE_FAILED_EXTERNAL_NETWORK_DETAILS_CANNOT_BE_EDITED=Cannot ${action} 
${type}. External network details (except name and description) cannot be 
changed.
 ACTION_TYPE_FAILED_EXTERNAL_NETWORK_NOT_SUPPORTED=Cannot ${action} ${type}. 
External networks are not supported for this cluster's compatibility version.
+ACTION_TYPE_FAILED_NOT_SUPPORTED_FOR_EXTERNAL_NETWORK=Cannot ${action} 
${type}. This operation is not supported for external networks.
 ACTION_TYPE_FAILED_EXTERNAL_NETWORK_CANNOT_BE_DISPLAY=Cannot ${action} 
${type}. External network cannot be used as a display network.
 ACTION_TYPE_FAILED_EXTERNAL_NETWORK_CANNOT_BE_REQUIRED=Cannot ${action} 
${type}. External network cannot be set as required in the cluster.
 ACTION_TYPE_FAILED_EXTERNAL_NETWORK_WITH_VLAN_MUST_BE_LABELED=Cannot ${action} 
${type}. External network with vlan must be labeled.


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

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

Reply via email to