vishesh92 commented on code in PR #12901:
URL: https://github.com/apache/cloudstack/pull/12901#discussion_r3015439800
##########
server/src/main/java/com/cloud/user/AccountManagerImpl.java:
##########
@@ -2138,6 +2139,24 @@ protected boolean isDeleteNeeded(AccountVO account, long
accountId, Account call
return true;
}
+ private void validateNoDeleteProtectedVms(Account account) {
+ long accountId = account.getId();
+ List<VMInstanceVO> deleteProtectedVms =
_vmDao.listDeleteProtectedVmsByAccountId(accountId);
+ if (deleteProtectedVms.isEmpty()) {
+ return;
+ }
+
+ if (logger.isDebugEnabled()) {
+ List<String> vmUuids =
deleteProtectedVms.stream().map(VMInstanceVO::getUuid).collect(Collectors.toList());
+ logger.debug("Cannot delete Account {} (id={}), delete protection
enabled for Instances: {}",
+ account.getAccountName(), accountId, vmUuids);
Review Comment:
```suggestion
logger.debug("Cannot delete Account {}, delete protection
enabled for Instances: {}",
account, vmUuids);
```
This logs the value of `toString()` method which includes these details.
https://github.com/apache/cloudstack/blob/7eea9ed4488b1df0b9cd3f00c502fea182a09aff/engine/schema/src/main/java/com/cloud/user/AccountVO.java#L232-L234
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]