mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Fix regression in output for Ctrl-c'ed CLI jobs (#37416)
https://github.com/saltstack/salt/pull/37115 backported a fix from develop into 2016.3 and inadvertently broke a fix that I had initially submitted in https://github.com/saltstack/salt/pull/36750. This commit corrects this regression.
This commit is contained in:
parent
e9b4620fac
commit
d749567f1e
@ -613,7 +613,7 @@ class LocalClient(object):
|
|||||||
was_listening = self.event.cpub
|
was_listening = self.event.cpub
|
||||||
|
|
||||||
try:
|
try:
|
||||||
pub_data = self.run_job(
|
self.pub_data = self.run_job(
|
||||||
tgt,
|
tgt,
|
||||||
fun,
|
fun,
|
||||||
arg,
|
arg,
|
||||||
@ -623,13 +623,13 @@ class LocalClient(object):
|
|||||||
listen=True,
|
listen=True,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
if not pub_data:
|
if not self.pub_data:
|
||||||
yield pub_data
|
yield self.pub_data
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
for fn_ret in self.get_cli_event_returns(
|
for fn_ret in self.get_cli_event_returns(
|
||||||
pub_data['jid'],
|
self.pub_data['jid'],
|
||||||
pub_data['minions'],
|
self.pub_data['minions'],
|
||||||
self._get_timeout(timeout),
|
self._get_timeout(timeout),
|
||||||
tgt,
|
tgt,
|
||||||
expr_form,
|
expr_form,
|
||||||
@ -642,12 +642,16 @@ class LocalClient(object):
|
|||||||
|
|
||||||
yield fn_ret
|
yield fn_ret
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
msg = ('Exiting on Ctrl-C\nThis job\'s jid is:\n{0}\n'
|
raise SystemExit(
|
||||||
'The minions may not have all finished running and any '
|
'\n'
|
||||||
'remaining minions will return upon completion. To '
|
'This job\'s jid is: {0}\n'
|
||||||
'look up the return data for this job later run:\n'
|
'Exiting gracefully on Ctrl-c\n'
|
||||||
'salt-run jobs.lookup_jid {0}').format(pub_data['jid'])
|
'The minions may not have all finished running and any '
|
||||||
raise SystemExit(msg)
|
'remaining minions will return upon completion. To look '
|
||||||
|
'up the return data for this job later, run the following '
|
||||||
|
'command:\n\n'
|
||||||
|
'salt-run jobs.lookup_jid {0}'.format(self.pub_data['jid'])
|
||||||
|
)
|
||||||
finally:
|
finally:
|
||||||
if not was_listening:
|
if not was_listening:
|
||||||
self.event.close_pub()
|
self.event.close_pub()
|
||||||
|
Loading…
Reference in New Issue
Block a user