CLOUDSTACK-7541: Added restriction to not allow custom disk offering with disksize UI doesn't allow but with API we were able to create custom disk offering with disk size which was causing this issue

This closes #28
This commit is contained in:
Anshul Gangwar 2014-10-22 09:59:42 +05:30 committed by Rajesh Battala
parent e8a47594da
commit efe47b0704

View File

@ -37,6 +37,8 @@ import javax.ejb.Local;
import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.apache.cloudstack.acl.SecurityChecker;
import org.apache.cloudstack.affinity.AffinityGroup;
import org.apache.cloudstack.affinity.AffinityGroupService;
@ -84,7 +86,6 @@ import org.apache.cloudstack.region.dao.RegionDao;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolDetailsDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
import org.apache.log4j.Logger;
import com.cloud.alert.AlertManager;
import com.cloud.api.ApiDBUtils;
@ -2347,6 +2348,10 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
throw new InvalidParameterValueException("Disksize is required for a non-customized disk offering");
}
if (isCustomized && numGibibytes != null) {
throw new InvalidParameterValueException("Disksize is not allowed for a customized disk offering");
}
boolean localStorageRequired = false;
String storageType = cmd.getStorageType();
if (storageType != null) {