Skip to content

Commit 91290ab

Browse files
author
Henrique Sato
committed
change state for destroyed
1 parent a257d93 commit 91290ab

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

api/src/main/java/com/cloud/user/Account.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public interface Account extends ControlledEntity, InternalIdentity, Identity {
3030
* Account states.
3131
* */
3232
enum State {
33-
DISABLED, ENABLED, LOCKED, REMOVED;
33+
DISABLED, ENABLED, LOCKED, DESTROYED;
3434

3535
/**
3636
* The toString method was overridden to maintain consistency in the DB, as the GenericDaoBase uses toString in the enum value to make the sql statements

engine/schema/src/main/resources/META-INF/db/schema-41800to41810.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ CALL ADD_GUEST_OS_AND_HYPERVISOR_MAPPING (6, 'Windows Server 2022 (64-bit)', 'Xe
3636
UPDATE `cloud`.`service_offering` so
3737
SET so.limit_cpu_use = 0
3838
WHERE so.default_use = 1 AND so.vm_type IN ('domainrouter', 'secondarystoragevm', 'consoleproxy', 'internalloadbalancervm', 'elasticloadbalancervm');
39+
40+
-- Set destroyed state for all removed accounts
41+
UPDATE `cloud`.`account` SET state='destroyed' WHERE `removed` IS NOT NULL;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ public boolean deleteAccount(AccountVO account, long callerUserId, Account calle
814814
return false;
815815
}
816816

817-
account.setState(State.REMOVED);
817+
account.setState(State.DESTROYED);
818818
_accountDao.update(accountId, account);
819819

820820
if (s_logger.isDebugEnabled()) {

0 commit comments

Comments
 (0)