From 668a831b229262dc74ba9458855bbdf961cd8bc7 Mon Sep 17 00:00:00 2001 From: abhishek Date: Tue, 7 Sep 2010 10:24:56 -0700 Subject: [PATCH] bug 6044: Added functionality to ensure vms belonging to deleted accounts do not show up status 6044: resolved fixed --- server/src/com/cloud/api/commands/ListVMsCmd.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/src/com/cloud/api/commands/ListVMsCmd.java b/server/src/com/cloud/api/commands/ListVMsCmd.java index 7bb83d85b35..e90b066819b 100644 --- a/server/src/com/cloud/api/commands/ListVMsCmd.java +++ b/server/src/com/cloud/api/commands/ListVMsCmd.java @@ -165,6 +165,14 @@ public class ListVMsCmd extends BaseCmd { } for (UserVm vmInstance : virtualMachines) { + + //if the account is deleted, do not return the user vm + Account currentVmAccount = getManagementServer().getAccount(vmInstance.getAccountId()); + if(currentVmAccount.getRemoved()!=null) + { + continue; //not returning this vm + } + List> vmData = new ArrayList>(); AsyncJobVO asyncJob = getManagementServer().findInstancePendingAsyncJob("vm_instance", vmInstance.getId()); if(asyncJob != null) {