mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Don't spin waiting for runner return, just use get_event (it has a poller)
Conflicts: salt/runner.py
This commit is contained in:
parent
eff95e8b1d
commit
7abf26ed59
@ -77,15 +77,15 @@ class SyncClientMixin(object):
|
||||
job = self.master_call(**low)
|
||||
ret_tag = salt.utils.event.tagify('ret', base=job['tag'])
|
||||
|
||||
timelimit = time.time() + (timeout or 300)
|
||||
while True:
|
||||
ret = self.event.get_event(tag=ret_tag, full=True, wait=timelimit)
|
||||
if ret is None:
|
||||
raise salt.exceptions.SaltClientTimeout(
|
||||
"RunnerClient job '{0}' timed out".format(job['jid']),
|
||||
jid=job['jid'])
|
||||
if timeout is None:
|
||||
timeout = 300
|
||||
ret = self.event.get_event(tag=ret_tag, full=True, wait=timeout)
|
||||
if ret is None:
|
||||
raise salt.exceptions.SaltClientTimeout(
|
||||
"RunnerClient job '{0}' timed out".format(job['jid']),
|
||||
jid=job['jid'])
|
||||
|
||||
return ret['data']['return']
|
||||
return ret['data']['return']
|
||||
|
||||
def cmd(self, fun, arg=None, pub_data=None, kwarg=None):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user