From 5ca8ec42037ed4e2a1475bf29064f61068308687 Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Fri, 7 Jan 2011 20:26:25 +0000 Subject: Fix pep8 errors. --- nova/image/glance.py | 2 +- nova/virt/xenapi/vm_utils.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nova/image/glance.py b/nova/image/glance.py index e40468364..3f8982c51 100644 --- a/nova/image/glance.py +++ b/nova/image/glance.py @@ -113,7 +113,7 @@ class ParallaxClient(object): if res.status == 200: # TODO(ewanmellor): Temporary hack! We should be parsing # the response from Glance properly. - return { 'url': '/images/%s' % image_id } + return {'url': '/images/%s' % image_id} else: # TODO(jaypipes): log the error? return None diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py index 98427acee..c5bd83b27 100644 --- a/nova/virt/xenapi/vm_utils.py +++ b/nova/virt/xenapi/vm_utils.py @@ -344,8 +344,8 @@ class VMHelper(HelperBase): cls._lookup_image_objectstore(session, vdi_ref) return - @classmethod - def _lookup_image_objectstore(cls,session,vdi_ref): + @classmethod + def _lookup_image_objectstore(cls, session, vdi_ref): logging.debug("Looking up vdi %s for PV kernel", vdi_ref) fn = "is_vdi_pv" args = {} @@ -360,25 +360,25 @@ class VMHelper(HelperBase): logging.debug("PV Kernel in VDI:%d", pv) return pv - @classmethod - def _lookup_image_glance(cls,session,vdi_ref): + @classmethod + def _lookup_image_glance(cls, session, vdi_ref): logging.debug("Looking up vdi %s for PV kernel", vdi_ref) - + def is_vdi_pv(dev): logging.debug("Running pygrub against %s", dev) output = os.popen('pygrub -qn /dev/%s' % dev) pv = False for line in output.readlines(): #try to find kernel string - m = re.search('(?<=kernel:)/.*(?:>)',line) + m = re.search('(?<=kernel:)/.*(?:>)', line) if m: - if m.group(0).find('xen')!=-1: + if m.group(0).find('xen') != -1: pv = True - logging.debug("PV:%d",pv) + logging.debug("PV:%d", pv) return pv pv = with_vdi_attached_here(session, vdi_ref, False, is_vdi_pv) return pv - + @classmethod def lookup(cls, session, i): """Look the instance i up, and returns it if available""" -- cgit