def set_supervisord_schedule(self,host=None, jid=None, name=None, ip=None): if not (host and jid and name and ip): print 'Missing options: host=%s, jid=%d, name=%s, ip=%s'%(host, jid, name, ip) self.logger.warning('Missing options: host=%s, jid=%d, name=%s, ip=%s'%(host, jid, name, ip)) supervisord_config = self.create_config_file(host=host, jid=jid, name=name, ip=ip) full_dir = SUPERVISORD["CONF_DIR"] + '/' + name + SUPERVISORD["CONF_EXTENSION"] filee = File() print filee.write(dir = full_dir, text = supervisord_config) self.logger.info("config file: %s, content: %s"%(full_dir, supervisord_config)) return 0
def finish(self, output_data): self.output_data = output_data File.write(self.output_file, self.output_data) self.time_finish = time.time() self.time_execution = self.time_finish - self.time_start if self.debug: print("------====== RESULT ======------") for line in self.output_data: print(line) print("------====== STATS ======------") print("Program ran for: ", self.time_execution, "seconds.")