xend: xenapi: Suspended domain causes fault if vif.get_all_records() is called
authorKeir Fraser <keir@xensource.com>
Tue, 16 Oct 2007 16:41:33 +0000 (17:41 +0100)
committerKeir Fraser <keir@xensource.com>
Tue, 16 Oct 2007 16:41:33 +0000 (17:41 +0100)
A single suspended domain on the system causes a fault when
vif.get_all_records() is called since this returns an ErrorDescription
and no 'Value' in the 'v' dictionary. This patch now returns a 'None'
as Value which might not be optimal but better than faulting.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
tools/python/xen/xend/XendAPI.py

index 9c119edb31b390a66a5fb03edaf0b5234c174f7e..183ddcb502db75cb222a7ebf2cfdab1b04fb073b 100644 (file)
@@ -555,7 +555,7 @@ class XendAPI(object):
                 return xen_api_success(ref)
 
             def unpack(v):
-                return v['Value']
+                return v.get('Value')
 
             def _get_all_records(_api_cls):
                 return lambda s, session: \