Fix handling of SXP for devices through device_add -- this solves the

Invalid device (uname) problem that breaks just about everything once you've
done xm block-attach.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
Ewan Mellor committed 2006-10-29 19:28:26 +00:00
1 parent 25884d981b
commit ad0cc56145
1 file changed
+2 -4
+2 -4
View File
@@ -769,12 +769,10 @@ class XendConfig(dict):
log.debug("XendConfig.device_add: %s" % str(cfg_xenapi))
if cfg_sxp:
config = sxp.child0(cfg_sxp)
dev_type = sxp.name(config)
dev_info = {}
try:
for opt, val in config[1:]:
for opt, val in cfg_sxp[1:]:
dev_info[opt] = val
except ValueError:
pass # SXP has no options for this device
@@ -856,7 +854,7 @@ class XendConfig(dict):
"""
sxpr = []
if dev_uuid != None and dev_uuid in self['device']:
dev_type, dev_info = self['device']
dev_type, dev_info = self['device'][dev_uuid]
if dev_type == None or dev_info == None:
raise XendConfigError("Required either UUID or device type and "
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.