1
0
mirror of https://github.com/Napsty/check_esxi_hardware.git synced 2024-11-23 19:03:48 +01:00

check_esxi_hardware.py: force exit on timeout

Replace sys.exit by os._exit to be sure that the script stops on timeout immediately and does not produce false-positive results (usually it comes to WARNING).
This commit is contained in:
Stanislav German-Evtushenko 2015-04-07 15:56:00 +03:00
parent e3a43a5dd0
commit b3c0ca4cdd

View File

@ -223,6 +223,7 @@ import pywbem
import re import re
import string import string
from optparse import OptionParser,OptionGroup from optparse import OptionParser,OptionGroup
import os
version = '20150119' version = '20150119'
@ -566,7 +567,7 @@ if os_platform != "win32":
import signal import signal
def handler(signum, frame): def handler(signum, frame):
print 'UNKNOWN: Execution time too long!' print 'UNKNOWN: Execution time too long!'
sys.exit(ExitUnknown) os._exit(ExitUnknown)
# connection to host # connection to host
verboseoutput("Connection to "+hosturl) verboseoutput("Connection to "+hosturl)