Ravi Nori has uploaded a new change for review.

Change subject: engine : Children of callback commands should not have callback 
enabled by default
......................................................................

engine : Children of callback commands should not have callback enabled by 
default

Children of commands with callback should have callback
enabled only if they have custom callbacks implemented

Change-Id: Ib6c0f1e42572dfa51b50d2e6cc9531a81c2f5aad
Bug-Url: https://bugzilla.redhat.com/1133041
Signed-off-by: Ravi Nori <rn...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandCoordinatorImpl.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandExecutor.java
2 files changed, 9 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/17/32717/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandCoordinatorImpl.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandCoordinatorImpl.java
index 7916fbc..43f5739 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandCoordinatorImpl.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandCoordinatorImpl.java
@@ -74,7 +74,12 @@
             
cmdEntity.setCallBackNotified(existingCmdEntity.isCallBackNotified());
         }
         commandsCache.put(cmdEntity);
-        if (cmdEntity.isCallBackEnabled()) {
+        // check if callback is enabled or if parent command has callback 
enabled
+        if (cmdEntity.isCallBackEnabled() ||
+                (!Guid.isNullOrEmpty(cmdEntity.getRootCommandId()) &&
+                        commandsCache.get(cmdEntity.getRootCommandId()) != 
null &&
+                        
commandsCache.get(cmdEntity.getRootCommandId()).isCallBackEnabled()
+                )) {
             buildCmdHierarchy(cmdEntity);
             if (!cmdEntity.isCallBackNotified()) {
                 cmdExecutor.addToCallBackMap(cmdEntity);
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandExecutor.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandExecutor.java
index 42c6964..913fe07 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandExecutor.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandExecutor.java
@@ -140,11 +140,11 @@
     }
 
     public Future<VdcReturnValueBase> executeAsyncCommand(final VdcActionType 
actionType,
-                                    final VdcActionParametersBase parameters,
-                                    final CommandContext cmdContext) {
+                                                          final 
VdcActionParametersBase parameters,
+                                                          final CommandContext 
cmdContext) {
         final CommandBase<?> command = 
CommandsFactory.createCommand(actionType, parameters, cmdContext);
-        command.persistCommand(command.getParameters().getParentCommand(), 
cmdContext, true);
         CommandCallBack callBack = command.getCallBack();
+        command.persistCommand(command.getParameters().getParentCommand(), 
cmdContext, callBack != null);
         if (callBack != null) {
             cmdCallBackMap.put(command.getCommandId(), callBack);
         }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib6c0f1e42572dfa51b50d2e6cc9531a81c2f5aad
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

Reply via email to