Updated Branches: refs/heads/master b0c67a3cc -> b0e06981c
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/b0e06981 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b0e06981 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b0e06981 Branch: refs/heads/master Commit: b0e06981c16a6341d10cc9b946bec5ae1ad484cb Parents: b0c67a3 Author: Sateesh Chodapuneedi <[email protected]> Authored: Wed Aug 14 12:47:58 2013 +0530 Committer: Sateesh Chodapuneedi <[email protected]> Committed: Wed Aug 14 12:47:58 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/b0e06981/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 1be105f..f20b257 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 @@ -1162,9 +1162,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."); + } } }
