Moti Asayag has posted comments on this change.

Change subject: core: allowed to add network label even if Vm using this 
network is running.
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.ovirt.org/#/c/32688/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/dc/UpdateNetworkCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/dc/UpdateNetworkCommand.java:

Line 114:     }
Line 115: 
Line 116:     @Override
Line 117:     protected boolean canDoAction() {
Line 118:         if (onlyPermittedFieldsChanged() && 
allowedNetworkLabelManipulation()) {
I'm not sure if it is currently blocked somewhere (maybe only on UI side), but 
we shouldn't permit setting a label for external networks.

If it is blocked on UI, we can skip adding that validation for now (until the 
api will support external providers).
Line 119:             return true;
Line 120:         }
Line 121: 
Line 122:         NetworkValidator validatorNew = new 
NetworkValidator(getNetwork());


Line 142: 
Line 143:     private boolean allowedNetworkLabelManipulation() {
Line 144:         Network oldNetwork = getOldNetwork();
Line 145:         Network newNetwork = getNetwork();
Line 146: 
SyncNetworkParametersBuilder contains those logic in labelAdded() & 
labelChanged()

perhaps it could be reused ?
Line 147:         boolean labelNotChanged = 
Objects.equals(oldNetwork.getLabel(), newNetwork.getLabel());
Line 148:         boolean newLabelAssigned = oldNetwork.getLabel() == null && 
newNetwork.getLabel() != null;
Line 149: 
Line 150:         return labelNotChanged || newLabelAssigned;


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I57a658a4e2d4648917a265493cde4749ad15e3ad
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Mucha <mmu...@redhat.com>
Gerrit-Reviewer: Lior Vernia <lver...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to