mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
we need to be more careful when making the SMinion
The SMinion is often used by backends like the salt client and api this change relies more heavily on the pyzmq components to resolve and return the correct loop, and only create the loop if needed.
This commit is contained in:
parent
7508d291d2
commit
edd6b95c60
1 changed files with 4 additions and 3 deletions
|
@ -585,9 +585,10 @@ class SMinion(MinionBase):
|
|||
# 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)):
|
||||
if HAS_ZMQ:
|
||||
zmq.eventloop.ioloop.install()
|
||||
io_loop = LOOP_CLASS.current()
|
||||
if self.opts['transport'] == 'zeromq' and HAS_ZMQ:
|
||||
io_loop = zmq.eventloop.ioloop.ZMQIOLoop()
|
||||
else:
|
||||
io_loop = LOOP_CLASS.current()
|
||||
io_loop.run_sync(
|
||||
lambda: self.eval_master(self.opts, failed=True)
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue