summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Washenberger <mark.washenberger@rackspace.com>2012-02-29 13:54:27 -0500
committerMark Washenberger <mark.washenberger@rackspace.com>2012-02-29 14:41:42 -0500
commitfd915aa78d8fbc09395c77ca84728b361edab416 (patch)
tree8e71b2cca3e040225b38f83649feb5c83e708ba7
parentf38281d60c033b61f30aff2ad05ed4b87d1f6ade (diff)
downloadnova-fd915aa78d8fbc09395c77ca84728b361edab416.tar.gz
nova-fd915aa78d8fbc09395c77ca84728b361edab416.tar.xz
nova-fd915aa78d8fbc09395c77ca84728b361edab416.zip
Cast vcpu_weight to string before calling xen api
Fixes bug 943490 - style changes per s1rp Change-Id: If6444aa0bff35c54c6c3d57f97507b16b1e27d6a
-rw-r--r--nova/virt/xenapi/vmops.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index 5985779e0..bc3f03ef3 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -467,11 +467,11 @@ class VMOps(object):
# Set VCPU weight
inst_type = db.instance_type_get(ctx, instance.instance_type_id)
- vcpu_weight = inst_type["vcpu_weight"]
- if str(vcpu_weight) != "None":
+ vcpu_weight = inst_type['vcpu_weight']
+ if vcpu_weight is not None:
LOG.debug(_("Setting VCPU weight"))
self._session.call_xenapi("VM.add_to_VCPUs_params", vm_ref,
- "weight", vcpu_weight)
+ "weight", str(vcpu_weight))
def _spawn(self, instance, vm_ref):
"""Spawn a new instance."""