Browse Source

handle KeyboardInterrupt

When running zuul in non-daemon mode (with -d), it is often useful to
abort it using Control + C.

Change-Id: I385a41625633f3120b95c07283bef015824e5853
Reviewed-on: https://review.openstack.org/13571
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
changes/40/13740/1
Antoine Musso 9 years ago
committed by Jenkins
parent
commit
6ad5d5b1af
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      zuul-server

+ 5
- 2
zuul-server View File

@ -101,8 +101,11 @@ class Server(object):
signal.signal(signal.SIGHUP, self.reconfigure_handler)
signal.signal(signal.SIGUSR1, self.exit_handler)
while True:
signal.pause()
try:
signal.pause()
except KeyboardInterrupt:
print "Ctrl + C: asking scheduler to exit nicely...\n"
self.exit_handler( signal.SIGINT, None )
if __name__ == '__main__':
server = Server()


Loading…
Cancel
Save