summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorSalvatore Orlando <salvatore.orlando@eu.citrix.com>2011-02-08 10:14:51 +0000
committerSalvatore Orlando <salvatore.orlando@eu.citrix.com>2011-02-08 10:14:51 +0000
commit2ecd9de1a0b26cd7168a008f44caad47ecb49c01 (patch)
tree6f043d6b7f8609fea859319484f5bf7247fadd89 /nova
parent93d6050078214945fd2c842a15fb177f24811fa1 (diff)
downloadnova-2ecd9de1a0b26cd7168a008f44caad47ecb49c01.tar.gz
nova-2ecd9de1a0b26cd7168a008f44caad47ecb49c01.tar.xz
nova-2ecd9de1a0b26cd7168a008f44caad47ecb49c01.zip
Fixed pep8 errors
Unit tests passed
Diffstat (limited to 'nova')
-rw-r--r--nova/virt/xenapi/vm_utils.py9
1 files changed, 6 insertions, 3 deletions
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"""