def shutdown_signal(signum, frame):
 LOG.warning('shutting down, got signal %d', signum)
 shutdown()

def shutdown_signal ( signum , frame ) : LOG . warning ( 'shutting down, got signal %d' , signum ) shutdown ( )
called when we get a signal and need to terminate .