From b3c0ca4cdd91c6895f8600f5de3b9b9708bad10b Mon Sep 17 00:00:00 2001 From: Stanislav German-Evtushenko Date: Tue, 7 Apr 2015 15:56:00 +0300 Subject: [PATCH] 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). --- check_esxi_hardware.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/check_esxi_hardware.py b/check_esxi_hardware.py index 876a026..6f816e7 100755 --- a/check_esxi_hardware.py +++ b/check_esxi_hardware.py @@ -223,6 +223,7 @@ import pywbem import re import string from optparse import OptionParser,OptionGroup +import os version = '20150119' @@ -566,7 +567,7 @@ if os_platform != "win32": import signal def handler(signum, frame): print 'UNKNOWN: Execution time too long!' - sys.exit(ExitUnknown) + os._exit(ExitUnknown) # connection to host verboseoutput("Connection to "+hosturl)