From fd915aa78d8fbc09395c77ca84728b361edab416 Mon Sep 17 00:00:00 2001 From: Mark Washenberger Date: Wed, 29 Feb 2012 13:54:27 -0500 Subject: Cast vcpu_weight to string before calling xen api Fixes bug 943490 - style changes per s1rp Change-Id: If6444aa0bff35c54c6c3d57f97507b16b1e27d6a --- nova/virt/xenapi/vmops.py | 6 +++--- 1 file 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.""" -- cgit