Support proper sigterm exiting

This commit is contained in:
Joshua Boniface 2018-06-16 22:30:17 -04:00
parent 9d4f773b94
commit 261d9394db
1 changed files with 4 additions and 0 deletions

View File

@ -24,6 +24,7 @@ import kazoo.client
import libvirt
import sys
import os
import signal
import socket
import psutil
import subprocess
@ -120,6 +121,9 @@ def cleanup():
zk.close()
update_timer.shutdown()
# Handle SIGTERM gracefully
signal.signal(signal.SIGTERM, cleanup)
# Gather useful data about our host for staticdata
# Static data format: 'cpu_count', 'arch', 'os', 'kernel'
staticdata = []