Skip to content

Commit

Permalink
Merge pull request #33993 from s0undt3ch/2016.3
Browse files Browse the repository at this point in the history
Call `sys.exit()` instead of `exit()`
  • Loading branch information
Mike Place committed Jun 14, 2016
2 parents 2e934cf + 34f7d90 commit 26fee37
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion salt/minion.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ def _handle_signals(self, signum, sigframe): # pylint: disable=unused-argument
self.process_manager.send_signal_to_processes(signum)
# kill any remaining processes
self.process_manager.kill_children()
exit(0)
sys.exit(0)

def sync_connect_master(self, timeout=None):
'''
Expand Down
2 changes: 1 addition & 1 deletion salt/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def suicide_when_without_parent(parent_pid):
delay = randint(1, delay)
log.info('waiting random_reauth_delay {0}s'.format(delay))
time.sleep(delay)
exit(salt.defaults.exitcodes.SALT_KEEPALIVE)
sys.exit(salt.defaults.exitcodes.SALT_KEEPALIVE)


def salt_minion():
Expand Down
3 changes: 2 additions & 1 deletion salt/transport/zeromq.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Import Python Libs
from __future__ import absolute_import
import os
import sys
import copy
import errno
import signal
Expand Down Expand Up @@ -636,7 +637,7 @@ def _handle_signals(self, signum, sigframe):
msg += 'SIGTERM'
msg += '. Exiting'
log.debug(msg)
exit(salt.defaults.exitcodes.EX_OK)
sys.exit(salt.defaults.exitcodes.EX_OK)


class ZeroMQPubServerChannel(salt.transport.server.PubServerChannel):
Expand Down
2 changes: 1 addition & 1 deletion salt/utils/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ def _handle_signals(self, signum, sigframe):
msg += 'SIGTERM'
msg += '. Exiting'
log.debug(msg)
exit(salt.defaults.exitcodes.EX_OK)
sys.exit(salt.defaults.exitcodes.EX_OK)

def start(self):
with default_signals(signal.SIGINT, signal.SIGTERM):
Expand Down
3 changes: 2 additions & 1 deletion salt/utils/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@
# Import python libs
from __future__ import absolute_import, with_statement
import os
import sys
import time
import signal
import datetime
Expand Down Expand Up @@ -788,7 +789,7 @@ def handle_func(self, multiprocessing_enabled, func, data):
finally:
if multiprocessing_enabled:
# Let's make sure we exit the process!
exit(salt.defaults.exitcodes.EX_GENERIC)
sys.exit(salt.defaults.exitcodes.EX_GENERIC)

def eval(self):
'''
Expand Down

0 comments on commit 26fee37

Please sign in to comment.