Amit Aviram has posted comments on this change. Change subject: engine:Check dependent VMs when removing template ......................................................................
Patch Set 2: (3 comments) http://gerrit.ovirt.org/#/c/37514/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/storage/StorageDomainValidator.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/storage/StorageDomainValidator.java: Line 251: } Line 252: return totalSizeForDisks; Line 253: } Line 254: Line 255: If your'e pushing a new patch maybe remove this line? redundant change.. Line 256: private static interface SizeAssessment { Line 257: public double getSizeForDisk(DiskImage diskImage); Line 258: } Line 259: Line 311: public ValidationResult isTemplateInUseByVmInStorageDomain(VmTemplate vmTemplate) { Line 312: List<VM> vmsInExportDomain = getVmsFromExportDomain(storageDomain); Line 313: List<String> problematicVmNames = new ArrayList<String>(); Line 314: for (VM vm : vmsInExportDomain) { Line 315: if (vmTemplate.getId().equals(vm.getVmtGuid())) { Are we sure that vmTemplate couldn't be null? Line 316: problematicVmNames.add(vm.getName()); Line 317: } Line 318: } Line 319: Line 318: } Line 319: Line 320: if (!problematicVmNames.isEmpty()) { Line 321: return new ValidationResult(VdcBllMessages.VMT_CANNOT_REMOVE_DETECTED_DERIVED_VM, Line 322: String.format("$vmsList %1$s", StringUtils.join(problematicVmNames, ","))); ReplacmentUtils does the string formatting for you, use it instead: ReplacmentUtils.replaceWith("vmsList",problematicVmNames) Line 323: } Line 324: return ValidationResult.VALID; Line 325: } Line 326: -- To view, visit http://gerrit.ovirt.org/37514 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8cba5df5a41973741a855ae0c9efddd56100d2fd Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Freddy Rolland <froll...@redhat.com> Gerrit-Reviewer: Ala Hino <ah...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Amit Aviram <aavi...@redhat.com> Gerrit-Reviewer: Candace Sheremeta <csher...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Fred Rolland <froll...@redhat.com> Gerrit-Reviewer: Freddy Rolland <froll...@redhat.com> Gerrit-Reviewer: Tal Nisan <tni...@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