mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Only generate the access keys once in the master before
spining up workers
This commit is contained in:
parent
a76e202003
commit
3493df2cb5
@ -26,6 +26,9 @@ from . import worker
|
||||
|
||||
__all__ = ['core', 'worker']
|
||||
|
||||
# Import salt libs
|
||||
import salt.daemons.masterapi
|
||||
|
||||
# Import ioflo libs
|
||||
import ioflo.app.run
|
||||
|
||||
@ -52,6 +55,7 @@ class IofloMaster(object):
|
||||
'''
|
||||
self.opts = opts
|
||||
self.preloads = explode_opts(self.opts)
|
||||
self.access_keys = salt.daemons.masterapi.access_keys(self.opts.value)
|
||||
|
||||
def _make_workers(self):
|
||||
'''
|
||||
@ -69,6 +73,8 @@ class IofloMaster(object):
|
||||
'''
|
||||
behaviors = ['salt.transport.road.raet', 'salt.daemons.flo']
|
||||
self.preloads.append(('.salt.yid', dict(value=yid)))
|
||||
self.preloads.append(
|
||||
('.salt.access_keys', dict(value=self.access_keys)))
|
||||
ioflo.app.run.start(
|
||||
name='worker{0}'.format(yid),
|
||||
period=float(self.opts['ioflo_period']),
|
||||
|
@ -17,7 +17,8 @@ class RouterWorker(ioflo.base.deeding.Deed):
|
||||
Ioinits = {
|
||||
'uxd_stack': '.salt.uxd.stack.stack',
|
||||
'opts': '.salt.opts',
|
||||
'yid': '.salt.yid'
|
||||
'yid': '.salt.yid',
|
||||
'access_keys': '.salt.access_keys',
|
||||
}
|
||||
|
||||
def postinitio(self):
|
||||
@ -34,10 +35,9 @@ class RouterWorker(ioflo.base.deeding.Deed):
|
||||
dirpath=self.opts.value['sock_dir'])
|
||||
self.uxd_stack.value.addRemoteYard(manor_yard)
|
||||
self.remote = salt.daemons.masterapi.RemoteFuncs(self.opts.value)
|
||||
self.access_keys = salt.daemons.masterapi.access_keys(self.opts.value)
|
||||
self.local = salt.daemons.masterapi.LocalFuncs(
|
||||
self.opts.value,
|
||||
self.access_keys)
|
||||
self.access_keys.value)
|
||||
|
||||
def action(self):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user