From 3356aebe4d830e8d488a8eba2847a58e621045f6 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Fri, 17 Dec 2010 16:41:35 +0000 Subject: bug fixes --- nova/compute/api.py | 7 ++----- nova/virt/xenapi/vm_utils.py | 10 +++------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/nova/compute/api.py b/nova/compute/api.py index 262a8819d..4c4b82272 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -84,12 +84,9 @@ class ComputeAPI(base.Base): logging.debug("Creating a raw instance") # Make sure we have access to kernel and ramdisk (if not raw) if kernel_id: - image_service.show(context, kernel_id) + self.image_service.show(context, kernel_id) if ramdisk_id: - image_service.show(context, ramdisk_id) - # Make sure we have access to kernel and ramdisk - self.image_service.show(context, kernel_id) - self.image_service.show(context, ramdisk_id) + self.image_service.show(context, ramdisk_id) if security_group is None: security_group = ['default'] diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py index 3c48c7aaf..4c58598c1 100644 --- a/nova/virt/xenapi/vm_utils.py +++ b/nova/virt/xenapi/vm_utils.py @@ -62,7 +62,6 @@ class VMHelper(): XenAPI = __import__('XenAPI') @classmethod - @defer.inlineCallbacks def create_vm(cls, session, instance, kernel, ramdisk, pv_kernel=False): """Create a VM record. Returns a Deferred that gives the new VM reference. @@ -170,7 +169,6 @@ class VMHelper(): return vif_ref @classmethod - @defer.inlineCallbacks def fetch_image(cls, session, image, user, project, type): """type: integer field for specifying how to handle the image 0 - kernel/ramdisk image (goes on dom0's filesystem) @@ -196,24 +194,22 @@ class VMHelper(): return uuid @classmethod - @defer.inlineCallbacks def lookup_image(cls, session, vdi_ref): logging.debug("Looking up vdi %s for PV kernel", vdi_ref) fn = "is_vdi_pv" args = {} args['vdi-ref'] = vdi_ref #TODO: Call proper function in plugin - task = yield session.async_call_plugin('objectstore', fn, args) - pv_str = yield session.wait_for_task(task) + task = session.async_call_plugin('objectstore', fn, args) + pv_str = session.wait_for_task(task) if pv_str.lower() == 'true': pv = True elif pv_str.lower() == 'false': pv = False logging.debug("PV Kernel in VDI:%d", pv) - defer.returnValue(pv) + return pv @classmethod - @utils.deferredToThread def lookup(cls, session, i): """ Look the instance i up, and returns it if available """ return VMHelper.lookup_blocking(session, i) -- cgit