mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
init the engines with a function
This commit is contained in:
parent
4dea1d838d
commit
896d008a52
@ -7,28 +7,24 @@ import multiprocessing
|
|||||||
|
|
||||||
# Import salt libs
|
# Import salt libs
|
||||||
import salt
|
import salt
|
||||||
|
import salt.loader
|
||||||
|
|
||||||
|
|
||||||
class StartEngines(object):
|
def start_engines(opts, proc_mgr):
|
||||||
'''
|
'''
|
||||||
Fire up the configured engines!
|
Fire up the configured engines!
|
||||||
'''
|
'''
|
||||||
def __init__(self, opts, proc_mgr):
|
engines = salt.loader.engines(opts)
|
||||||
self.opts = opts
|
for engine in opts.get('engines', []):
|
||||||
self.proc_mgr = proc_mgr
|
if engine in engines:
|
||||||
self.engines = salt.loader.engines(self.opts)
|
proc_mgr.add_process(
|
||||||
|
Engine,
|
||||||
def run(self):
|
args=(
|
||||||
for engine in self.opts.get('engines', []):
|
opts,
|
||||||
if engine in self.engines:
|
engine,
|
||||||
self.proc_mgr.add_process(
|
opts['engines'][engine]
|
||||||
Engine,
|
|
||||||
args=(
|
|
||||||
self.opts,
|
|
||||||
engine,
|
|
||||||
self.opts['engines'][engine]
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Engine(multiprocessing.Process):
|
class Engine(multiprocessing.Process):
|
||||||
|
Loading…
Reference in New Issue
Block a user