From 2ecd9de1a0b26cd7168a008f44caad47ecb49c01 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Tue, 8 Feb 2011 10:14:51 +0000 Subject: Fixed pep8 errors Unit tests passed --- nova/virt/xenapi/vm_utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'nova') diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py index 4f6de7588..2d2200805 100644 --- a/nova/virt/xenapi/vm_utils.py +++ b/nova/virt/xenapi/vm_utils.py @@ -438,12 +438,15 @@ class VMHelper(HelperBase): return vdis else: return None + @classmethod - def lookup_kernel_ramdisk(cls,session,vm): + def lookup_kernel_ramdisk(cls, session, vm): vm_rec = session.get_xenapi().VM.get_record(vm) - return (vm_rec['PV_kernel'],vm_rec['PV_ramdisk']) + if 'PV_kernel' in vm_rec and 'PV_ramdisk' in vm_rec: + return (vm_rec['PV_kernel'], vm_rec['PV_ramdisk']) + else: + return (None, None) - @classmethod def compile_info(cls, record): """Fill record with VM status information""" -- cgit