X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fomf_resctl.py;h=a5f4c687d8fb0ab4f7e7b75ba19fceae45e89357;hb=fbf0fd3367f34d39b0b562820d786d7854824ba6;hp=1f174533228a674795cf96cf79d561025383c000;hpb=66db0978b275eec1dbffc862e68715a1b63dd31d;p=nodemanager.git diff --git a/plugins/omf_resctl.py b/plugins/omf_resctl.py index 1f17453..a5f4c68 100644 --- a/plugins/omf_resctl.py +++ b/plugins/omf_resctl.py @@ -13,7 +13,8 @@ import subprocess import tools import logger -priority = 50 +# we need this to run after sliverauth +priority = 150 def start(): pass @@ -22,10 +23,12 @@ def start(): # hard-wire this for now # once the variables are expanded, this is expected to go into config_ple_template="""--- -# Example: -# _slicename_ = nicta_ruby -# _hostname_ = planetlab1.research.nicta.com.au -# _xmpp_server_ = xmpp.planet-lab.eu +# slicename = _slicename_ +# hostname = _hostname_ +# xmpp_server = _xmpp_server_ +# we extract expires time here, even in a comment so that the +# trigger script gets called whenever this changes +# expires: _expires_ :uid: _slicename_@_hostname_ :uri: xmpp://_slicename_-_hostname_-<%= "#{Process.pid}" %>:_slicename_-_hostname_-<%= "#{Process.pid}" %>@_xmpp_server_ @@ -84,11 +87,13 @@ def GetSlivers(data, conf = None, plc = None): # skip non OMF-friendly slices if not is_omf_friendly (sliver): continue slicename=sliver['name'] + expires=str(sliver['expires']) yaml_template = config_ple_template yaml_contents = yaml_template\ .replace('_xmpp_server_',xmpp_server)\ .replace('_slicename_',slicename)\ - .replace('_hostname_',hostname) + .replace('_hostname_',hostname)\ + .replace('_expires_',expires) yaml_full_path="/vservers/%s/%s"%(slicename,yaml_slice_path) yaml_full_dir=os.path.dirname(yaml_full_path) if not os.path.isdir(yaml_full_dir):