Skip to content

Commit 4396526

Browse files
committed
delete need check reversed
1 parent 19ed026 commit 4396526

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

server/src/main/java/com/cloud/user/AccountManagerImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,7 @@ public boolean deleteUserAccount(long accountId) {
18121812
// If the user is a System user, return an error. We do not allow this
18131813
AccountVO account = _accountDao.findById(accountId);
18141814

1815-
if (checkDeleteNeeded(account, caller)) {
1815+
if (! isDeleteNeeded(account, caller)) {
18161816
return true;
18171817
}
18181818

@@ -1832,14 +1832,14 @@ public boolean deleteUserAccount(long accountId) {
18321832
return deleteAccount(account, callerUserId, caller);
18331833
}
18341834

1835-
private boolean checkDeleteNeeded(AccountVO account, Account caller) {
1835+
private boolean isDeleteNeeded(AccountVO account, Account caller) {
18361836
if (account == null) {
18371837
s_logger.info("The account:" + account.getAccountName() + " doesn't exist");
1838-
return true;
1838+
return false;
18391839
}
18401840
if (account.getRemoved() != null) {
18411841
s_logger.info("The account:" + account.getAccountName() + " is already removed");
1842-
return true;
1842+
return false;
18431843
}
18441844
// don't allow removing Project account
18451845
if (account.getType() == Account.Type.PROJECT) {
@@ -1852,7 +1852,7 @@ private boolean checkDeleteNeeded(AccountVO account, Account caller) {
18521852
if (account.isDefault()) {
18531853
throw new InvalidParameterValueException("The account is default and can't be removed");
18541854
}
1855-
return false;
1855+
return true;
18561856
}
18571857

18581858
@Override

0 commit comments

Comments
 (0)