Hello Eli Mesika,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/18391

to review the following change.

Change subject: core: [ExternalTasks] Cannot end existing job
......................................................................

core: [ExternalTasks] Cannot end existing job

Enable to set the JobId or Step Id as parameters to commands that are
not monitored but handle the External Job/Tasks :
EndExternalJobCommand
ClearExternalJobCommand
EndExternalStepCommand

Change-Id: I78f72cd619e32e5763f46391932ec70730a2b4b7
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=988094
Signed-off-by: Eli Mesika <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/Backend.java
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/91/18391/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/Backend.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/Backend.java
index d9c08d6..662516e 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/Backend.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/Backend.java
@@ -376,7 +376,7 @@
             CommandContext context) {
         VdcReturnValueBase result;
         // If non-monitored command is invoked with JobId or ActionId as 
parameters, reject this command on can do action.
-        if (!actionType.isActionMonitored() && (parameters.getJobId() != null 
|| parameters.getStepId() != null)) {
+        if (!actionType.isActionMonitored() && !isActionExternal(actionType) 
&& (parameters.getJobId() != null || parameters.getStepId() != null)) {
             result = new VdcReturnValueBase();
             
result.getCanDoActionMessages().add(VdcBllMessages.ACTION_TYPE_NON_MONITORED.toString());
             result.setCanDoAction(false);
@@ -389,6 +389,10 @@
         return result;
     }
 
+    private boolean isActionExternal(VdcActionType actionType){
+        return (actionType == VdcActionType.EndExternalJob || actionType == 
VdcActionType.EndExternalStep || actionType == VdcActionType.ClearExternalJob);
+    }
+
     protected VdcReturnValueBase runAction(CommandBase<?> command,
             boolean runAsInternal,
             CommandContext context) {


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I78f72cd619e32e5763f46391932ec70730a2b4b7
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to