CLOUDSTACK-3155 [VMware] Deletion of zone should not be allowed if VMware DC is still associated with that zone.
Check if there exists any VMware DC already associated with this zone. Deny zone deletion if true. Signed-off-by: Sateesh Chodapuneedi <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e9df9c29 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e9df9c29 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e9df9c29 Branch: refs/heads/vmsync Commit: e9df9c29bde4374e443c91ed91e2706b6074082f Parents: bd5ad44 Author: Sateesh Chodapuneedi <[email protected]> Authored: Mon Jun 24 12:11:31 2013 +0530 Committer: Sateesh Chodapuneedi <[email protected]> Committed: Mon Jun 24 12:11:31 2013 +0530 ---------------------------------------------------------------------- .../src/com/cloud/configuration/ConfigurationManagerImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e9df9c29/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 425c8be..89a640d 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -1301,6 +1301,12 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati physicalNetworks.add(2, "there are physical networks in this zone"); tablesToCheck.add(physicalNetworks); + List<String> vmwareDcs = new ArrayList<String>(); + vmwareDcs.add(0, "vmware_data_center_zone_map"); + vmwareDcs.add(1, "zone_id"); + vmwareDcs.add(2, "there are VMware datacenters associated with this zone. Remove VMware DC from this zone."); + tablesToCheck.add(vmwareDcs); + for (List<String> table : tablesToCheck) { String tableName = table.get(0); String column = table.get(1);
