X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sliver_libvirt.py;h=778eb1044ad21d0235eb57a0a2ba606f70ab4339;hb=070b6366b3ab3f2d97c8399eafc00a19af907923;hp=619448fdb76a010eb87ab89586dcac087386ece8;hpb=aaed32c80a83c4c8eb1db7f93ec7fb32f3a74c5e;p=nodemanager.git diff --git a/sliver_libvirt.py b/sliver_libvirt.py index 619448f..778eb10 100644 --- a/sliver_libvirt.py +++ b/sliver_libvirt.py @@ -9,7 +9,7 @@ import libvirt from account import Account import logger -import bwlimit +import plnode.bwlimit as bwlimit import cgroups STATES = { @@ -163,3 +163,28 @@ class Sliver_Libvirt(Account): # Call the upper configure method (ssh keys...) Account.configure(self, rec) + # A placeholder until we get true VirtualInterface objects + @staticmethod + def get_interfaces_xml(rec): + xml = """ + + + +""" + 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) + 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']) + + return xml