X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sliver_libvirt.py;h=ed430885894c85a7a5312a56836caac849af9a7f;hb=37fb58922dd8b6429ccb4a2b94d4ca907ee83232;hp=778eb1044ad21d0235eb57a0a2ba606f70ab4339;hpb=723c15893937e6350c620f63073a691e5a447a6a;p=nodemanager.git
diff --git a/sliver_libvirt.py b/sliver_libvirt.py
index 778eb10..ed43088 100644
--- a/sliver_libvirt.py
+++ b/sliver_libvirt.py
@@ -174,15 +174,33 @@ class Sliver_Libvirt(Account):
try:
tags = rec['rspec']['tags']
if 'interface' in tags:
- interface = eval(tags['interface'])
- if 'bridge' in interface:
- xml = """
-
-
-
-
-""" % interface['bridge']
- logger.log('sliver_libvirty.py: interface XML is: %s' % xml)
+ interfaces = eval(tags['interface'])
+ if not isinstance(interfaces, (list, tuple)):
+ # if interface is not a list, then make it into a singleton list
+ interfaces = [interfaces]
+ tag_xml = ""
+ for interface in interfaces:
+ if 'vlan' in interface:
+ vlanxml = "" % interface['vlan']
+ else:
+ vlanxml = ""
+ if 'bridge' in interface:
+ tag_xml = tag_xml + """
+
+
+ %s
+
+
+ """ % (interface['bridge'], vlanxml)
+ else:
+ tag_xml = tag_xml + """
+
+
+
+ """
+ xml = tag_xml
+ logger.log('sliver_libvirty.py: interface XML is: %s' % xml)
+
except:
logger.log('sliver_libvirt.py: ERROR parsing "interface" tag for slice %s' % rec['name'])
logger.log('sliver_libvirt.py: tag value: %s' % tags['interface'])