Tomas Jelinek has posted comments on this change. Change subject: webadmin: Allow reboot without Guest Agent ......................................................................
Patch Set 1: (1 comment) http://gerrit.ovirt.org/#/c/34271/1/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java: Line 3637: Line 3638: for (VM vm : vms) { Line 3639: Version version = vm.getVdsGroupCompatibilityVersion(); Line 3640: Version anyDcVersion = new Version(); Line 3641: if (!isCommandCompatible(VdcActionType.RebootVm, version, anyDcVersion) || OK, this starts to be VERY hard to read - I had to rewrite it to paper and get rid of the negations to understand that it is correct :) What about rewrite it to something like this? boolean compatibleWithCluster = isCommandCompatible(VdcActionType.RebootVm, version, anyDcVersion); boolean guestAgentPresent = !StringHelper.isNullOrEmpty(vm.getVmIp()); boolean acpiEnabled = Boolean.TRUE.equals(vm.getAcpiEnable())); return compatibleWithCluster && (guestAgentPresent || acpiEnabled); Line 3642: // no guest agent nor acpi enabled Line 3643: (StringHelper.isNullOrEmpty(vm.getVmIp()) && Boolean.FALSE.equals(vm.getAcpiEnable()))) { Line 3644: return false; Line 3645: } -- To view, visit http://gerrit.ovirt.org/34271 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e546122d27786465f355c112b218b128b357d1a Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Betak <mbe...@redhat.com> Gerrit-Reviewer: Tomas Jelinek <tjeli...@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