mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Clean up minion shutdown
Also cleaner logging for cases where the master could not be contacted.
This commit is contained in:
parent
08dd663a27
commit
8a4969b730
1 changed files with 6 additions and 1 deletions
|
@ -920,6 +920,8 @@ class Minion(MinionBase):
|
|||
try:
|
||||
result = channel.send(load, timeout=timeout)
|
||||
return True
|
||||
except salt.exceptions.SaltReqTimeoutError:
|
||||
log.info('fire_master failed: master could not be contacted. Request timed out.')
|
||||
except Exception:
|
||||
log.info('fire_master failed: {0}'.format(traceback.format_exc()))
|
||||
return False
|
||||
|
@ -1716,7 +1718,10 @@ class Minion(MinionBase):
|
|||
self.pub_channel.on_recv(self._handle_payload)
|
||||
|
||||
if start:
|
||||
self.io_loop.start()
|
||||
try:
|
||||
self.io_loop.start()
|
||||
except KeyboardInterrupt:
|
||||
self.destroy()
|
||||
|
||||
def _handle_payload(self, payload):
|
||||
if payload is not None and self._target_load(payload['load']):
|
||||
|
|
Loading…
Add table
Reference in a new issue