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:
Prachi Damle 2014-04-22 18:34:01 -07:00 committed by Daan Hoogland
parent 9aab6046ae
commit 3d072b0d02
1 changed files with 8 additions and 1 deletions

View File

@ -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());
}
}
}