Updated Branches: refs/heads/affinity_groups 953f90616 -> 2a1163c67
CLOUDSTACK-1968: affinity_groups: Column 'deployment planner' cannot be null when creating a service offering Added default value to all constructors.. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2a1163c6 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2a1163c6 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2a1163c6 Branch: refs/heads/affinity_groups Commit: 2a1163c673df5ce86a2fb3629210e577fb9c5e64 Parents: 953f906 Author: Prachi Damle <[email protected]> Authored: Mon Apr 8 11:04:01 2013 -0700 Committer: Prachi Damle <[email protected]> Committed: Mon Apr 8 11:12:29 2013 -0700 ---------------------------------------------------------------------- .../src/com/cloud/service/ServiceOfferingVO.java | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2a1163c6/server/src/com/cloud/service/ServiceOfferingVO.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/service/ServiceOfferingVO.java b/server/src/com/cloud/service/ServiceOfferingVO.java index 40f817d..a3da904 100755 --- a/server/src/com/cloud/service/ServiceOfferingVO.java +++ b/server/src/com/cloud/service/ServiceOfferingVO.java @@ -87,6 +87,7 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering this.volatileVm = false; this.default_use = defaultUse; this.vm_type = vm_type == null ? null : vm_type.toString().toLowerCase(); + this.deploymentPlanner = "FirstFitPlanner"; } public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitCpuUse, boolean volatileVm, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId) { @@ -100,11 +101,13 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering this.limitCpuUse = limitCpuUse; this.volatileVm = volatileVm; this.vm_type = vm_type == null ? null : vm_type.toString().toLowerCase(); + this.deploymentPlanner = "FirstFitPlanner"; } public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitResourceUse, boolean volatileVm, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId, String hostTag) { this(name, cpu, ramSize, speed, rateMbps, multicastRateMbps, offerHA, limitResourceUse, volatileVm, displayText, useLocalStorage, recreatable, tags, systemUse, vm_type, domainId); this.hostTag = hostTag; + this.deploymentPlanner = "FirstFitPlanner"; } public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, @@ -113,7 +116,11 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering String hostTag, String deploymentPlanner) { this(name, cpu, ramSize, speed, rateMbps, multicastRateMbps, offerHA, limitResourceUse, volatileVm, displayText, useLocalStorage, recreatable, tags, systemUse, vm_type, domainId, hostTag); - this.deploymentPlanner = deploymentPlanner; + if (deploymentPlanner != null) { + this.deploymentPlanner = deploymentPlanner; + } else { + this.deploymentPlanner = "FirstFitPlanner"; + } } @Override
