Comment 1 for bug 1223559

Revision history for this message
Yongli He (yongli-he) wrote : Re: pci passthrough fails with "NameError: global name '_' is not defined"

hi, David
could you paste the new trace to the bug ? (note it with the patch) that's close to the fix i think.

diff --git a/nova/objects/pci_device.py b/nova/objects/pci_device.py
index a83b8f3..d0a628a 100644
--- a/nova/objects/pci_device.py
+++ b/nova/objects/pci_device.py
@@ -145,7 +145,7 @@ class PciDevice(base.NovaPersistentObject,
base.NovaObject):
             if key != 'extra_info':
                 pci_device[key] = db_dev[key]
             else:
- extra_info = db_dev.get("extra_info")
+ extra_info = db_dev.get("extra_info", '{}')
                 pci_device.extra_info = jsonutils.loads(extra_info)
         pci_device._context = context
         pci_device.obj_reset_changes()

--
Russell Bryant