Allon Mureinik has uploaded a new change for review.

Change subject: core: ImportVm cleanup: action and type params
......................................................................

core: ImportVm cleanup: action and type params

The $action and $type params were set in canDoAction_afterCloneVm, which
caused them to be empty if the command failed during
canDoAction_beforeCloneVm.

This patch moves them to the canDoAction() method, so they are set if
any failure occured, regardless of its stage.

Change-Id: I9b3148cd54146ac0b90924464cd27fb54160889b
Signed-off-by: Allon Mureinik <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
1 file changed, 8 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/20/9620/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
index 86fa8f4..ef41eeb 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
@@ -136,7 +136,14 @@
             initImportClonedVm();
         }
 
-        return retVal && canDoAction_afterCloneVm(retVal, canDoActionMessages, 
domainsMap);
+        retVal = retVal && canDoAction_afterCloneVm(retVal, 
canDoActionMessages, domainsMap);
+
+        if (!retVal) {
+            addCanDoActionMessage(VdcBllMessages.VAR__ACTION__IMPORT);
+            addCanDoActionMessage(VdcBllMessages.VAR__TYPE__VM);
+        }
+
+        return retVal;
     }
 
 
@@ -373,10 +380,6 @@
             retVal = validateMacAddress(getVm().getInterfaces());
         }
 
-        if (!retVal) {
-            addCanDoActionMessage(VdcBllMessages.VAR__ACTION__IMPORT);
-            addCanDoActionMessage(VdcBllMessages.VAR__TYPE__VM);
-        }
         return retVal;
     }
 


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

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

Reply via email to