+# given that we're now responsible for fetching this one, I have to
+# decide on an actual path - not jsut a name to search for in PATH
+omf_rc_trigger_script="/usr/bin/plc_trigger_omf_rc"
+
+# hopefully temporary: when trigger script is missing, fetch it at the url here
+omf_rc_trigger_url="http://git.mytestbed.net/?p=omf.git;a=blob_plain;f=omf_rc/bin/plc_trigger_omf_rc;hb=HEAD"
+def fetch_trigger_script_if_missing (slicename):
+ full_path="/vservers/%s/%s"%(slicename,omf_rc_trigger_script)
+ if not os.path.isfile (full_path):
+ retcod=subprocess.call (['curl','--silent','-o',full_path,omf_rc_trigger_url])
+ if retcod!=0:
+ logger.log("Could not fetch %s"%omf_rc_trigger_url)
+ else:
+ subprocess.call(['chmod','+x',full_path])
+ logger.log("omf_resctl: fetched %s"%(full_path))
+ logger.log("omf_resctl: from %s"%(omf_rc_trigger_url))