def __init__(self, conf, work_queue, logger_location): super().__init__() self.conf = conf self.logger = auth_app_utils.get_logger(self.conf.name, logger_location, self.conf.logger_level, 1) self.work_queue = work_queue
def __init__(self, work_queue, logger_location): super().__init__() self.work_queue = work_queue self.logger = auth_app_utils.get_logger('rabbitmq', logger_location, logging.DEBUG, 1) self.logger.info('inited')
def __init__(self, work_queue, logger_location, host, port): super().__init__() self.work_queue = work_queue self.logger = auth_app_utils.get_logger('rabbitmq', logger_location, logging.DEBUG, 1) self.server_host = host self.server_port = port self.logger.info('inited')
def __init__(self, work_queue, logger_location, url, port, sleep_period): super().__init__() self.work_queue = work_queue self.logger = auth_app_utils.get_logger('prometheus-importer', logger_location, logging.DEBUG, 1) self.server_url = url self.server_port = port self.sleep_period = sleep_period self.learned_macs_compiled_regex = re.compile(LEARNED_MACS_REGEX)
def _handle_sigint(self, sigid, frame): """Handles the SIGINT signal. Closes the hostapd control interfaces, and kills the main thread ('self.run'). """ self.logger.info('SIGINT Received - Killing hostapd socket threads ...') for t in self.threads: t.kill() self.logger.info('Threads killed') sys.exit() if __name__ == "__main__": print('Parsing args ...') parser = argparse.ArgumentParser() parser.add_argument('config', metavar='config', type=str, nargs=1, help='path to configuration file') args = parser.parse_args() config_filename = '/etc/faucet/gasket/auth.yaml' if args.config: config_filename = args.config[0] print('Loading config %s' % config_filename) auth_config = AuthConfig(config_filename) log = auth_app_utils.get_logger('auth_app', auth_config.logger_location, auth_config.logger_level, 1) aa = AuthApp(auth_config, log) print('Running AuthApp') try: aa.start() except Exception as e: log.exception(e)
self.logger.info( 'SIGINT Received - Killing hostapd socket threads ...') for t in self.threads: t.kill() self.logger.info('Threads killed') sys.exit() if __name__ == "__main__": print('Parsing args ...') parser = argparse.ArgumentParser() parser.add_argument('config', metavar='config', type=str, nargs=1, help='path to configuration file') args = parser.parse_args() config_filename = '/etc/ryu/faucet/gasket/auth.yaml' if args.config: config_filename = args.config[0] print('Loading config %s' % config_filename) auth_config = AuthConfig(config_filename) log = auth_app_utils.get_logger('auth_app', auth_config.logger_location, logging.DEBUG, 1) aa = AuthApp(auth_config, log) print('Running AuthApp') try: aa.start() except Exception as e: log.exception(e)