You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ra...@apache.org on 2015/04/30 11:11:53 UTC

[5/6] git commit: updated refs/heads/master to 866cc41

CLOUDSTACK-8422: Fixed unable to delete zone from CCP
this closes #202


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f46ed592
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f46ed592
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f46ed592

Branch: refs/heads/master
Commit: f46ed592901b155f988d01d8f9c6d6510d604f8f
Parents: 48067e5
Author: Anshul Gangwar <an...@citrix.com>
Authored: Tue Apr 21 13:36:41 2015 +0530
Committer: Rajesh Battala <ra...@citrix.com>
Committed: Thu Apr 30 14:44:18 2015 +0530

----------------------------------------------------------------------
 .../com/cloud/configuration/ConfigurationManagerImpl.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f46ed592/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index d0d0315..06eff48 100644
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -954,7 +954,11 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
 
             String selectSql = "SELECT * FROM `" + dbName + "`.`" + tableName + "` WHERE " + column + " = ?";
 
-            if (tableName.equals("host") || tableName.equals("cluster") || tableName.equals("volumes") || tableName.equals("vm_instance")) {
+            if(tableName.equals("vm_instance")) {
+                selectSql += " AND state != '" + VirtualMachine.State.Expunging.toString() + "' AND removed IS NULL";
+            }
+
+            if (tableName.equals("host") || tableName.equals("cluster") || tableName.equals("volumes")) {
                 selectSql += " and removed IS NULL";
             }
 
@@ -1426,7 +1430,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
             }
 
             if (tableName.equals("vm_instance")) {
-                selectSql += " AND state != '" + VirtualMachine.State.Expunging.toString() + "'";
+                selectSql += " AND state != '" + VirtualMachine.State.Expunging.toString() + "' AND removed IS NULL";
             }
 
             TransactionLegacy txn = TransactionLegacy.currentTxn();