Ravi Nori has uploaded a new change for review.

Change subject: engine : ovirt-node enter installing status when the install 
fails
......................................................................

engine : ovirt-node enter installing status when the install fails

When ovirt-node installation fails because of missing iso file
the status of the host is left as Installing.

This patch sets the status to InstallFailed and returns the
error messages in CanDoActionMessages so the message can be
displayed in cli

Change-Id: I2d74e946cb68d2b9dbc11fc5c6bed9f63ba35fe2
Bug-Url: https://bugzilla.redhat.com/947982
Signed-off-by: Ravi Nori <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsCommand.java
1 file changed, 14 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/22/13622/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsCommand.java
index f8e4197..1d8a8a7 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsCommand.java
@@ -141,6 +141,7 @@
                 if (vdcReturnValueBase != null && 
!vdcReturnValueBase.getCanDoAction()) {
                     ArrayList<String> canDoActionMessages = 
vdcReturnValueBase.getCanDoActionMessages();
                     if (!canDoActionMessages.isEmpty()) {
+                        
getReturnValue().getCanDoActionMessages().addAll(vdcReturnValueBase.getCanDoActionMessages());
                         log.errorFormat("Installation/upgrade of Host {0},{1} 
failed due to: {2} ",
                                 getVdsId(),
                                 getVdsName(),
@@ -149,7 +150,14 @@
                                         
.TranslateErrorText(canDoActionMessages),
                                         ","));
                     }
+                    getReturnValue().setCanDoAction(false);
                     setSucceeded(false);
+                    // the status that was set to Installing in updateVdsData 
needs
+                    // to set to InstallFailed if Installation/Upgrade fails
+                    // in InstallVds command
+                    if (getParameters().getInstallVds()) {
+                        setVdsStatus(VDSStatus.InstallFailed);
+                    }
                     return;
                 }
             }
@@ -191,11 +199,15 @@
         });
 
         if (getParameters().getInstallVds()) {
-            runVdsCommand(VDSCommandType.SetVdsStatus,
-                    new SetVdsStatusVDSCommandParameters(getVdsId(), 
VDSStatus.Installing));
+            setVdsStatus(VDSStatus.Installing);
         }
     }
 
+    private void setVdsStatus(VDSStatus status) {
+        runVdsCommand(VDSCommandType.SetVdsStatus,
+                    new SetVdsStatusVDSCommandParameters(getVdsId(), status));
+    }
+
     private boolean NeedToUpdateVdsBroker() {
         return VdsHandler.IsFieldsUpdated(getParameters().getVdsStaticData(), 
_oldVds.getStaticData(),
                 UPDATE_FIELDS_VDS_BROKER);


--
To view, visit http://gerrit.ovirt.org/13622
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d74e946cb68d2b9dbc11fc5c6bed9f63ba35fe2
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to