mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Teach all non-daemon scripts how to cleanly exit on CTRL-c
Using: raise SystemExit('some message') is equivalent to: sys.stderr.write('some message\n') sys.exit(1)
This commit is contained in:
parent
1b8ec74efd
commit
021cebbbf3
5 changed files with 20 additions and 5 deletions
|
@ -14,4 +14,7 @@ def main():
|
|||
client.run()
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
raise SystemExit('\nExiting gracefully on Ctrl-c')
|
||||
|
|
|
@ -15,4 +15,7 @@ def main():
|
|||
client.run()
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
raise SystemExit('\nExiting gracefully on Ctrl-c')
|
||||
|
|
|
@ -14,4 +14,7 @@ def main():
|
|||
cp_.run()
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
raise SystemExit('\nExiting gracefully on Ctrl-c')
|
||||
|
|
|
@ -14,4 +14,7 @@ def main():
|
|||
saltkey.run()
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
raise SystemExit('\nExiting gracefully on Ctrl-c')
|
||||
|
|
|
@ -14,4 +14,7 @@ def main():
|
|||
client.run()
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
raise SystemExit('\nExiting gracefully on Ctrl-c')
|
||||
|
|
Loading…
Add table
Reference in a new issue