Fix xenapi_create re: Multiple VIFs for test 04_restore_withdevices_pos

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
This commit is contained in:
Ewan Mellor committed 2007-03-23 11:00:08 +00:00
1 parent a28f499e56
commit a24516689f
1 file changed
+8 -4
+8 -4
View File
@@ -611,7 +611,10 @@ class sxp2xml:
vif = document.createElement("vif")
dev = get_child_by_name(vif_sxp, "vifname", "eth0")
dev = get_child_by_name(vif_sxp, "vifname", None)
if dev is None:
dev = self.getFreshEthDevice()
vif.attributes["name"] \
= "vif" + str(dev.__hash__())
@@ -628,7 +631,8 @@ class sxp2xml:
return vif
_eths = -1
def getFreshEthDevice(self):
self._eths += 1
return "eth%i" % self._eths
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.