Ravi Nori has uploaded a new change for review. Change subject: webadmin: Reason does not get updated when trying to shutdown a VM which is Powering up of Shutting Down ......................................................................
webadmin: Reason does not get updated when trying to shutdown a VM which is Powering up of Shutting Down When trying to stop the VM while it is powering up or shutting down, the reason comment does not get saved in the DB On the second shut down, the reason text box should be initialized with the former reason text, and the user will be allowed to edit it as he will The reason column is populated with the reason only when a single vm is being shutdown Change-Id: I0b10ed39563385cf99a366a32eebcc0c5ce08e72 Bug-Url: https://bugzilla.redhat.com/1114903 Signed-off-by: Ravi Nori <rn...@redhat.com> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java 1 file changed, 10 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/55/29955/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java index 6182fdc..e68e0de 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java @@ -31,6 +31,7 @@ import org.ovirt.engine.core.common.businessentities.VDS; import org.ovirt.engine.core.common.businessentities.VDSGroup; import org.ovirt.engine.core.common.businessentities.VM; +import org.ovirt.engine.core.common.businessentities.VMStatus; import org.ovirt.engine.core.common.businessentities.VmTemplate; import org.ovirt.engine.core.common.businessentities.VmType; import org.ovirt.engine.core.common.businessentities.VmWatchdog; @@ -1672,10 +1673,17 @@ model.setMessage(message); ArrayList<String> items = new ArrayList<String>(); + boolean stoppingSingleVM = getSelectedItems().size() == 1 && + (actionName.equals(SHUTDOWN) || actionName.equals(STOP)); for (Object item : getSelectedItems()) { - VM a = (VM) item; - items.add(a.getName()); + VM vm = (VM) item; + items.add(vm.getName()); + // If a single VM in status PoweringDown is being stopped the reason field + // is populated with the current reason so the user can edit it. + if (stoppingSingleVM && reasonVisible && VMStatus.PoweringDown.equals(vm.getStatus())) { + model.getReason().setEntity(vm.getStopReason()); + } } model.setItems(items); -- To view, visit http://gerrit.ovirt.org/29955 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0b10ed39563385cf99a366a32eebcc0c5ce08e72 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Ravi Nori <rn...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches