Updated Branches:
  refs/heads/4.2 4f3e648f4 -> 507f74221

CLOUDSTACK-4326 Adding VMware DC to legacy zone should not be allowed by API

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/507f7422
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/507f7422
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/507f7422

Branch: refs/heads/4.2
Commit: 507f74221379a63e452705672bec81f51d49758d
Parents: 4f3e648
Author: Sateesh Chodapuneedi <[email protected]>
Authored: Wed Aug 14 12:47:58 2013 +0530
Committer: Sateesh Chodapuneedi <[email protected]>
Committed: Wed Aug 14 12:51:01 2013 +0530

----------------------------------------------------------------------
 .../hypervisor/vmware/manager/VmwareManagerImpl.java    | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/507f7422/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
----------------------------------------------------------------------
diff --git 
a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
 
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
index b9afeaf..4d24562 100755
--- 
a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
+++ 
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
@@ -1173,9 +1173,15 @@ public class VmwareManagerImpl extends ManagerBase 
implements VmwareManager, Vmw
         // Check if zone with specified id exists
         DataCenterVO zone = _dcDao.findById(zoneId);
         if (zone == null) {
-            InvalidParameterValueException ex = new 
InvalidParameterValueException(
-                    "Can't find zone by the id specified.");
-            throw ex;
+            throw new InvalidParameterValueException("Can't find zone by the 
id specified.");
+        }
+        // Check if zone is legacy zone
+        if (isLegacyZone(zoneId)) {
+            throw new InvalidParameterValueException("The specified zone is 
legacy zone. Adding VMware datacenter to legacy zone is not supported.");
+        } else {
+            if (s_logger.isTraceEnabled()) {
+                s_logger.trace("The specified zone is not legacy zone.");
+            }
         }
     }
 

Reply via email to