Esempio n. 1
0
 def setUpClass(cls):
     '''
     Load the reactor config for mocking
     '''
     cls.opts = cls.get_temp_config('master')
     reactor_config = yaml.safe_load(REACTOR_CONFIG)
     cls.opts.update(reactor_config)
     cls.reactor = reactor.Reactor(cls.opts)
     cls.reaction_map = salt.utils.repack_dictlist(reactor_config['reactor'])
     renderers = salt.loader.render(cls.opts, {})
     cls.render_pipe = [(renderers[x], '') for x in ('jinja', 'yaml')]
Esempio n. 2
0
 def setUpClass(cls):
     """
     Load the reactor config for mocking
     """
     cls.opts = cls.get_temp_config("master")
     reactor_config = salt.utils.yaml.safe_load(REACTOR_CONFIG)
     cls.opts.update(reactor_config)
     cls.reactor = reactor.Reactor(cls.opts)
     cls.reaction_map = salt.utils.data.repack_dictlist(
         reactor_config["reactor"])
     renderers = salt.loader.render(cls.opts, {})
     cls.render_pipe = [(renderers[x], "") for x in ("jinja", "yaml")]
Esempio n. 3
0
def reactor_process(opts, reactor):
    opts = dict(opts)
    opts['reactor'] = reactor
    proc = reactor.Reactor(opts)
    proc.start()
    try:
        if os.environ.get('TRAVIS_PYTHON_VERSION', None) is not None:
            # Travis is slow
            time.sleep(10)
        else:
            time.sleep(2)
        yield
    finally:
        clean_proc(proc)
Esempio n. 4
0
def master_reactor(master_config):
    return reactor.Reactor(master_config)
Esempio n. 5
0
def minion_reactor(minion_config):
    return reactor.Reactor(minion_config)