aboutsummaryrefslogtreecommitdiffstats
path: root/tools/python
diff options
context:
space:
mode:
authorIan Jackson <Ian.Jackson@eu.citrix.com>2010-06-25 15:13:11 +0100
committerIan Jackson <Ian.Jackson@eu.citrix.com>2010-06-25 15:13:11 +0100
commita2fab4fce5401b510d237fd12d12a5382c5091b0 (patch)
tree43754b9b2a61decc65e4d4de9037c674f86c2f7d /tools/python
parentd5da15306fbff357726d6c8ba0925a7aca1bbb31 (diff)
downloadxen-a2fab4fce5401b510d237fd12d12a5382c5091b0.tar.gz
xen-a2fab4fce5401b510d237fd12d12a5382c5091b0.tar.bz2
xen-a2fab4fce5401b510d237fd12d12a5382c5091b0.zip
xend: Fix up check "mac" address sooner change
In changeset 21653, dev_type = sxp.name(dev_config) should not have been moved, otherwise, the checking "mac" paragraph is of no use. (The original patch as submitted was correct but I had to make the change manually as it had been mangled.) Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by Chunyan Liu <CYLiu@novell.com>
Diffstat (limited to 'tools/python')
-rw-r--r--tools/python/xen/xend/XendDomainInfo.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index 91aa7b696a..1432725a11 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -833,6 +833,8 @@ class XendDomainInfo:
@type dev_config: SXP object (parsed config)
"""
log.debug("XendDomainInfo.device_create: %s" % scrub_password(dev_config))
+ dev_type = sxp.name(dev_config)
+
if dev_type == 'vif':
for x in dev_config:
if x != 'vif' and x[0] == 'mac':
@@ -840,7 +842,6 @@ class XendDomainInfo:
log.error("Virtual network interface creation error - invalid MAC Address entered: %s", x[1])
raise VmError("Cannot create a new virtual network interface - MAC address is not valid!");
- dev_type = sxp.name(dev_config)
dev_uuid = self.info.device_add(dev_type, cfg_sxp = dev_config)
dev_config_dict = self.info['devices'][dev_uuid][1]
log.debug("XendDomainInfo.device_create: %s" % scrub_password(dev_config_dict))