Alona Kaplan 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? 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, it cannot be changed (networkNotChanged() should verify it, right?). So why do you need this (getOldNetwork()) method? Are you passing not completely internalized attachment when you want to remove it? If so, isn't is more readable to have RemoveNetworkAttachmentValidator.java? 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 <masa...@redhat.com> Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Martin Mucha <mmu...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches