Martin Mucha has posted comments on this change.

Change subject: engine: Add ModifiedNetworkAttachmentValidator
......................................................................


Patch Set 15:

(2 comments)

https://gerrit.ovirt.org/#/c/34967/15/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/ModifiedNetworkAttachmentValidator.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/ModifiedNetworkAttachmentValidator.java:

Line 36:                 getNetworkNameReplacement())
Line 37:                 
.when(managementNetworkUtil.isManagementNetwork(getOldNetwork().getId()));
Line 38:     }
Line 39: 
Line 40:     public ValidationResult networkNotUsedByVms(String networkName) {
> Should this method be private? Will it be ever externally used?
Done
Line 41:         List<String> vmNames =
Line 42:                 new 
VmInterfaceManager().findActiveVmsUsingNetworks(host.getId(),
Line 43:                         Collections.singleton(networkName));
Line 44: 


Line 67: 
Line 68:         return oldAttachment;
Line 69:     }
Line 70: 
Line 71:     private Network getOldNetwork() {
> The network is part of the identity key of the attachment. As I understand,
I don't understand what's 'internalized attachment'...

but is seems to be used only in: notRemovingManagementNetwork, and since 
network cannot be changed (you're correct), we can replace querying for old 
(existing) network by old (existing) id with networkId present in 
networkAttachment. The only drawback I can think of is creating dependence to 
another validator, which must run prior to this one and validate that network 
did not change... It's not probable, that someone will use this class 
elsewhere, but if he will, he'd need to *remember*, that he has to use another 
validator in specific way.
Line 72:         if (oldNetwork == null) {
Line 73:             oldNetwork = 
getDbFacade().getNetworkDao().get(getOldNetworkAttachment().getNetworkId());
Line 74:         }
Line 75: 


-- 
To view, visit https://gerrit.ovirt.org/34967
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie64dff04dbf43b8507b0559d82dc56a24e170e7d
Gerrit-PatchSet: 15
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Moti Asayag <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Mucha <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to