summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Kearney <josh@jk0.org>2011-09-08 12:11:39 -0500
committerJosh Kearney <josh@jk0.org>2011-09-08 12:11:39 -0500
commit3f6738b9f07640b0950793975cfc55e62aa3e1ad (patch)
tree30f6189527fa292af2c33cc3c233f9521524f608
parent763bf3f1282e3d9723a356d4014a9599601637eb (diff)
Use .get instead.
-rw-r--r--nova/virt/xenapi/vmops.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index bb53a52bc..9c138ee41 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -194,7 +194,7 @@ class VMOps(object):
# point for file injection.
first_vdi_ref = None
for vdi in vdis:
- if vdi['vdi_type'] != 'swap':
+ if vdi.get('vdi_type') != 'swap':
# Create the VM ref and attach the first disk
first_vdi_ref = self._session.call_xenapi(
'VDI.get_by_uuid', vdi['vdi_uuid'])