mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #31760 from sakateka/fix_master_switch
SMinion need wait future from eval_master
This commit is contained in:
commit
b23a08f3f4
1 changed files with 6 additions and 3 deletions
|
@ -448,6 +448,7 @@ class MinionBase(object):
|
|||
log.error(msg)
|
||||
sys.exit(salt.defaults.exitcodes.EX_GENERIC)
|
||||
|
||||
# FIXME: if SMinion don't define io_loop, it can't switch master see #29088
|
||||
# Specify kwargs for the channel factory so that SMinion doesn't need to define an io_loop
|
||||
# (The channel factories will set a default if the kwarg isn't passed)
|
||||
factory_kwargs = {'timeout': timeout, 'safe': safe}
|
||||
|
@ -517,9 +518,11 @@ class SMinion(MinionBase):
|
|||
super(SMinion, self).__init__(opts)
|
||||
|
||||
# Clean out the proc directory (default /var/cache/salt/minion/proc)
|
||||
if (self.opts.get('file_client', 'remote') == 'remote'
|
||||
or self.opts.get('use_master_when_local', False)):
|
||||
self.eval_master(self.opts, failed=True)
|
||||
if (self.opts.get('file_client', 'remote') == 'remote' or
|
||||
self.opts.get('use_master_when_local', False)):
|
||||
# actually eval_master returns the future and we need to wait for it
|
||||
self.io_loop = zmq.eventloop.ioloop.ZMQIOLoop()
|
||||
self.io_loop.run_sync(lambda: self.eval_master(self.opts, failed=True))
|
||||
self.gen_modules(initial_load=True)
|
||||
|
||||
def gen_modules(self, initial_load=False):
|
||||
|
|
Loading…
Add table
Reference in a new issue