sudo87 commented on code in PR #12901:
URL: https://github.com/apache/cloudstack/pull/12901#discussion_r3051665923


##########
server/src/main/java/com/cloud/user/AccountManagerImpl.java:
##########
@@ -2138,6 +2139,23 @@ protected boolean isDeleteNeeded(AccountVO account, long 
accountId, Account call
         return true;
     }
 
+    private void validateNoDeleteProtectedVmsForAccount(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 {}, delete protection enabled 
for Instances: {}", account, vmUuids);

Review Comment:
   its handled in the Dao, limit of 10 vmUuids are enforced.



-- 
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]

Reply via email to