Repository: cloudstack Updated Branches: refs/heads/master f4757a198 -> a21604619
CLOUDSTACK-7165:[Automation] NPE observed during restart and expunge VM. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a2160461 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a2160461 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a2160461 Branch: refs/heads/master Commit: a2160461911bec0365c5a6a2eaff84cc396661ad Parents: f4757a1 Author: Min Chen <min.c...@citrix.com> Authored: Fri Jul 25 15:50:02 2014 -0700 Committer: Min Chen <min.c...@citrix.com> Committed: Fri Jul 25 15:51:47 2014 -0700 ---------------------------------------------------------------------- server/src/com/cloud/api/dispatch/ParamProcessWorker.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a2160461/server/src/com/cloud/api/dispatch/ParamProcessWorker.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/api/dispatch/ParamProcessWorker.java b/server/src/com/cloud/api/dispatch/ParamProcessWorker.java index 07c45ba..ad90812 100644 --- a/server/src/com/cloud/api/dispatch/ParamProcessWorker.java +++ b/server/src/com/cloud/api/dispatch/ParamProcessWorker.java @@ -33,7 +33,6 @@ import java.util.regex.Matcher; import javax.inject.Inject; - import org.apache.log4j.Logger; import org.apache.cloudstack.acl.ControlledEntity; @@ -220,16 +219,17 @@ public class ParamProcessWorker implements DispatchWorker { private void doAccessChecks(BaseCmd cmd, Map<Object, AccessType> entitiesToAccess) { Account caller = CallContext.current().getCallingAccount(); - Account owner = _accountMgr.getActiveAccountById(cmd.getEntityOwnerId()); + // due to deleteAccount design flaw CLOUDSTACK-6588, we should still include those removed account as well to clean up leftover resources from that account + Account owner = _accountMgr.getAccount(cmd.getEntityOwnerId()); if (cmd instanceof BaseAsyncCreateCmd) { // check that caller can access the owner account. - _accountMgr.checkAccess(caller, null, true, owner); + _accountMgr.checkAccess(caller, null, false, owner); } if (!entitiesToAccess.isEmpty()) { // check that caller can access the owner account. - _accountMgr.checkAccess(caller, null, true, owner); + _accountMgr.checkAccess(caller, null, false, owner); for (Map.Entry<Object,AccessType>entry : entitiesToAccess.entrySet()) { Object entity = entry.getKey(); if (entity instanceof ControlledEntity) {