def __init__(self, db, executor, api_user, api_key, sender, endpoint): super(MailAgent, self).__init__(db) self.mail_proxy = MailProxy(api_user=api_user, api_key=api_key, sender=sender, endpoint=endpoint) self.executor_driver_name = executor self.executor = get_executor(executor)
def __init__(self, db, executor, username, password, epid, endpoint, charset="gb2312"): super(SmsAgent, self).__init__(db) self.sms_proxy = SmsProxy(username=username, password=password, epid=epid, endpoint=endpoint, charset=charset) self.executor_driver_name = executor self.executor = get_executor(executor)
def __init__(self, worker=8, executor="ssh"): self.worker = worker self.executor_driver_name = executor self.executor = get_executor(executor) self.db = HMonitorDB(mysql_user=options.mysql_user, mysql_passwd=options.mysql_password, mysql_host=options.mysql_host, mysql_database=options.mysql_database) self.queue = Queue.Queue() for w in range(0, self.worker): t = threading.Thread(target=self.do_autofix) t.daemon = True t.start() logging.debug("START {0} WORKERS FOR AUTOFIX".format(self.worker))
def __init__(self, db, executor, url): self.db = db self.executor_driver_name = executor self.executor = get_executor(executor) self.autofix_url = url