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

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
This commit is contained in:
Sateesh Chodapuneedi 2013-08-14 12:47:58 +05:30
parent b0c67a3cc5
commit b0e06981c1

View File

@ -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.");
}
}
}