Skip to content

Commit 056d21e

Browse files
committed
Fix bugs found from marvin test.
1 parent 91882e2 commit 056d21e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎services/iam/plugin/src/org/apache/cloudstack/api/command/iam/RemoveIAMPolicyFromAccountCmd.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.apache.cloudstack.api.BaseAsyncCmd;
3030
import org.apache.cloudstack.api.Parameter;
3131
import org.apache.cloudstack.api.ServerApiException;
32+
import org.apache.cloudstack.api.response.AccountResponse;
3233
import org.apache.cloudstack.api.response.SuccessResponse;
3334
import org.apache.cloudstack.api.response.iam.IAMPolicyResponse;
3435
import org.apache.cloudstack.context.CallContext;
@@ -59,7 +60,7 @@ public class RemoveIAMPolicyFromAccountCmd extends BaseAsyncCmd {
5960
private Long id;
6061

6162
@ACL
62-
@Parameter(name = ApiConstants.ACCOUNTS, type = CommandType.LIST, collectionType = CommandType.UUID, entityType = IAMPolicyResponse.class, description = "comma separated list of iam policy id that are going to be applied to the iam group.")
63+
@Parameter(name = ApiConstants.ACCOUNTS, type = CommandType.LIST, collectionType = CommandType.UUID, entityType = AccountResponse.class, description = "comma separated list of iam policy id that are going to be applied to the iam group.")
6364
private List<Long> accountIdList;
6465

6566

‎services/iam/server/src/org/apache/cloudstack/iam/server/IAMServiceImpl.java‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,9 +607,8 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
607607
// add entries in acl_group_policy_map table
608608
for (Long acctId : acctIds) {
609609
IAMAccountPolicyMapVO acctMap = _aclAccountPolicyMapDao.findByAccountAndPolicy(acctId, policyId);
610-
if (acctMap == null) {
611-
// not there already
612-
acctMap = new IAMAccountPolicyMapVO(acctId, policyId);
610+
if (acctMap != null) {
611+
// exists
613612
_aclAccountPolicyMapDao.remove(acctMap.getId());
614613
}
615614
}

0 commit comments

Comments
 (0)