def __init__(self, config):
        persistence_class = config_manager.get_backend_class(config["persistence"])
        messaging_class = config_manager.get_backend_class(config["messaging"])

        self.messaging = messaging_class(config=config["messaging"], queue="status")
        self.datapoints = persistence_class(config=config["persistence"])
        self.running = False
Exemplo n.º 2
0
    def __init__(self, config):
        persistence_class = \
            config_manager.get_backend_class(config['persistence'])
        messaging_class = \
            config_manager.get_backend_class(config['messaging'])

        self.messaging = messaging_class(config=config['messaging'],
                                         queue='status')
        self.datapoints = persistence_class(config=config['persistence'])
        self.running = False
Exemplo n.º 3
0
def run():
    arguments = argument_parsing()
    logging_setup(arguments=arguments)

    config = get_configuration('default')
    updater_class = get_backend_class(config, 'updaterbackend')
    messaging = get_backend_class(config=config, key='messagingbackend')

    updater = updater_class(config=config, messaging=messaging)
    signal.signal(signal.SIGTERM, updater.stop)
    signal.signal(signal.SIGHUP, updater.stop)
    signal.signal(signal.SIGINT, updater.stop)
    updater.start()
Exemplo n.º 4
0
def run():
    arguments = argument_parsing()
    logging_setup(arguments=arguments)

    config = get_configuration('default')
    updater_class = get_backend_class(config, 'updaterbackend')
    messaging = get_backend_class(config=config,
                                  key='messagingbackend')

    updater = updater_class(config=config, messaging=messaging)
    signal.signal(signal.SIGTERM, updater.stop)
    signal.signal(signal.SIGHUP, updater.stop)
    signal.signal(signal.SIGINT, updater.stop)
    updater.start()
 def test_get_backend_class(self):
     configuration = get_configuration(section_name='some_section',
                                       config_file=self.config_file.name,
                                       variables_file=self.env_file.name)
     backend_class = get_backend_class(configuration)
     self.assertTrue('Backend' in str(backend_class))
 def test_get_backend_class(self):
     configuration = get_configuration(section_name='some_section',
                                       config_file=self.config_file.name,
                                       variables_file=self.env_file.name)
     backend_class = get_backend_class(configuration)
     self.assertTrue('Backend' in str(backend_class))