mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-6458: IAM - When a domain is deleted , the group created for this domian is not removed.
Changes: - When domain is deleted or is removed during account cleanup, send message to IAM to remove the domain group
This commit is contained in:
parent
9aab6046ae
commit
3d072b0d02
|
|
@ -227,7 +227,11 @@ public class DomainManagerImpl extends ManagerBase implements DomainManager, Dom
|
|||
|
||||
@Override
|
||||
public boolean removeDomain(long domainId) {
|
||||
return _domainDao.remove(domainId);
|
||||
boolean removed = _domainDao.remove(domainId);
|
||||
if (removed) {
|
||||
_messageBus.publish(_name, MESSAGE_REMOVE_DOMAIN_EVENT, PublishScope.LOCAL, domainId);
|
||||
}
|
||||
return removed;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -324,6 +328,9 @@ public class DomainManagerImpl extends ManagerBase implements DomainManager, Dom
|
|||
" because it can't be removed due to resources referencing to it");
|
||||
domain.setState(Domain.State.Active);
|
||||
_domainDao.update(domain.getId(), domain);
|
||||
} else {
|
||||
// succeeded in removing the domain
|
||||
_messageBus.publish(_name, MESSAGE_REMOVE_DOMAIN_EVENT, PublishScope.LOCAL, domain.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue