Yair Zaslavsky has uploaded a new change for review.

Change subject: aaa: Change the check of internal command execution
......................................................................

aaa: Change the check of internal command execution

Both canDoAction and executeAction set the isSucceeded flag
to false if they fail.
We should check if AddUser or AddGroup failed not just by their
canDoAction phase, but also by their execution phase.
Hence, using the isSuceeded flag is more appropriate solution.

Bug-Url: https://bugzilla.redhat.com/1121954
Change-Id: Ie7093e3e20387c2cb9d56c818ac4b74d49b07ad1
Topic: AAA
Signed-off-by: Yair Zaslavsky <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddPermissionCommand.java
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/00/34300/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddPermissionCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddPermissionCommand.java
index 5915bc9..397f041 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddPermissionCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddPermissionCommand.java
@@ -212,7 +212,7 @@
         if (dbUser.getDomain() != null && dbUser.getExternalId() != null) {
             AddUserParameters parameters = new AddUserParameters(dbUser);
             VdcReturnValueBase result = 
runInternalAction(VdcActionType.AddUser, parameters, 
cloneContextAndDetachFromParent());
-            if (result.getCanDoAction()) {
+            if (result.getSucceeded()) {
                 Guid id = (Guid) result.getActionReturnValue();
                 if (id != null) {
                     return getDbUserDAO().get(id);
@@ -229,7 +229,7 @@
         if (groupToAdd.getDomain() != null && groupToAdd.getExternalId() != 
null) {
             AddGroupParameters parameters = new AddGroupParameters(groupToAdd);
             VdcReturnValueBase result = 
runInternalAction(VdcActionType.AddGroup, parameters, 
cloneContextAndDetachFromParent());
-            if (result.getCanDoAction()) {
+            if (result.getSucceeded()) {
                 Guid id = (Guid) result.getActionReturnValue();
                 if (id != null) {
                     return getAdGroupDAO().get(id);


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

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

Reply via email to