|
18 | 18 |
|
19 | 19 | import javax.inject.Inject; |
20 | 20 |
|
21 | | -import org.apache.log4j.Logger; |
22 | | - |
23 | 21 | import org.apache.cloudstack.acl.SecurityChecker.AccessType; |
24 | 22 | import org.apache.cloudstack.api.ACL; |
25 | 23 | import org.apache.cloudstack.api.APICommand; |
|
33 | 31 | import org.apache.cloudstack.api.response.SuccessResponse; |
34 | 32 | import org.apache.cloudstack.context.CallContext; |
35 | 33 | import org.apache.cloudstack.region.RegionService; |
| 34 | +import org.apache.log4j.Logger; |
36 | 35 |
|
37 | 36 | import com.cloud.event.EventTypes; |
38 | 37 | import com.cloud.user.Account; |
39 | | -import com.cloud.user.User; |
40 | 38 |
|
41 | 39 | @APICommand(name = "deleteAccount", description = "Deletes a account, and all users associated with this account", responseObject = SuccessResponse.class, entityType = {Account.class}, |
42 | 40 | requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) |
@@ -92,14 +90,15 @@ public String getEventType() { |
92 | 90 |
|
93 | 91 | @Override |
94 | 92 | public String getEventDescription() { |
95 | | - User user = _responseGenerator.findUserById(getId()); |
96 | | - return (user != null ? ("deleting User " + user.getUsername() + " (id: " + user.getId() + ") and accountId = " + user.getAccountId()) |
97 | | - : "user delete, but this user does not exist in the system"); |
| 93 | + Account account = _accountService.getAccount(getId()); |
| 94 | + return (account != null ? "Deleting user account " + account.getAccountName() + " (ID: " + account.getUuid() + ") and all corresponding users" |
| 95 | + : "Account delete, but this account does not exist in the system"); |
98 | 96 | } |
99 | 97 |
|
100 | 98 | @Override |
101 | 99 | public void execute() { |
102 | | - CallContext.current().setEventDetails("Account Id: " + getId()); |
| 100 | + Account account = _accountService.getAccount(getId()); |
| 101 | + CallContext.current().setEventDetails("Account ID: " + (account != null ? account.getUuid() : getId())); // Account not found is already handled by service |
103 | 102 |
|
104 | 103 | boolean result = _regionService.deleteUserAccount(this); |
105 | 104 | if (result) { |
|
0 commit comments