- for f in data['conf_files']:
- try: self.update_conf_file(f)
- except: logger.log_exc()
-
- def run(self):
- while True:
- self.cond.acquire()
- while self.data == None: self.cond.wait()
- data = self.data
- self.data = None
- self.cond.release()
- self.run_once(data)
-
- def callback(self, data):
- if data != None:
- self.cond.acquire()
- self.data = data
- self.cond.notify()
- self.cond.release()
-
-main = None
-
-def start(options, config):
- global main
- main = conf_files(config)
- tools.as_daemon_thread(main.run)
-
-def GetSlivers(data):
- global main
- assert main is not None
- return main.callback(data)
+ if data.has_key("conf_files"):
+ for f in data['conf_files']:
+ try: self.update_conf_file(f)
+ except: logger.log_exc("conf_files: failed to update conf_file")
+ else:
+ logger.log_missing_data("conf_files.run_once",'conf_files')
+
+
+def start(): pass
+
+def GetSlivers(data, config = None, plc = None):
+ logger.log("conf_files: Running.")
+ cf = conf_files()
+ cf.run_once(data)
+ logger.log("conf_files: Done.")