Skip to content

Commit 3d072b0

Browse files
Prachi DamleDaanHoogland
authored andcommitted
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
1 parent 9aab604 commit 3d072b0

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎server/src/com/cloud/user/DomainManagerImpl.java‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,11 @@ public Set<Long> getDomainParentIds(long domainId) {
227227

228228
@Override
229229
public boolean removeDomain(long domainId) {
230-
return _domainDao.remove(domainId);
230+
boolean removed = _domainDao.remove(domainId);
231+
if (removed) {
232+
_messageBus.publish(_name, MESSAGE_REMOVE_DOMAIN_EVENT, PublishScope.LOCAL, domainId);
233+
}
234+
return removed;
231235
}
232236

233237
@Override
@@ -324,6 +328,9 @@ public boolean deleteDomain(DomainVO domain, Boolean cleanup) {
324328
" because it can't be removed due to resources referencing to it");
325329
domain.setState(Domain.State.Active);
326330
_domainDao.update(domain.getId(), domain);
331+
} else {
332+
// succeeded in removing the domain
333+
_messageBus.publish(_name, MESSAGE_REMOVE_DOMAIN_EVENT, PublishScope.LOCAL, domain.getId());
327334
}
328335
}
329336
}

0 commit comments

Comments
 (0)