mirror of https://github.com/apache/cloudstack.git
Removed state for removed accounts (#7868)
Co-authored-by: Henrique Sato <henrique.sato@scclouds.com.br>
This commit is contained in:
parent
ae5dda867f
commit
31e2b629ee
|
|
@ -30,7 +30,7 @@ public interface Account extends ControlledEntity, InternalIdentity, Identity {
|
|||
* Account states.
|
||||
* */
|
||||
enum State {
|
||||
DISABLED, ENABLED, LOCKED;
|
||||
DISABLED, ENABLED, LOCKED, REMOVED;
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -180,3 +180,6 @@ CREATE TABLE `cloud`.`vm_scheduled_job` (
|
|||
-- Add support for different cluster types for kubernetes
|
||||
ALTER TABLE `cloud`.`kubernetes_cluster` ADD COLUMN `cluster_type` varchar(64) DEFAULT 'CloudManaged' COMMENT 'type of cluster';
|
||||
ALTER TABLE `cloud`.`kubernetes_cluster` MODIFY COLUMN `kubernetes_version_id` bigint unsigned NULL COMMENT 'the ID of the Kubernetes version of this Kubernetes cluster';
|
||||
|
||||
-- Set removed state for all removed accounts
|
||||
UPDATE `cloud`.`account` SET state='removed' WHERE `removed` IS NOT NULL;
|
||||
|
|
|
|||
|
|
@ -814,6 +814,9 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
|
|||
return false;
|
||||
}
|
||||
|
||||
account.setState(State.REMOVED);
|
||||
_accountDao.update(accountId, account);
|
||||
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Removed account " + accountId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue