From 65c3bd2a25d0c5636b1e2c1ab32fc542a9e2e551 Mon Sep 17 00:00:00 2001 From: Markus Opolka Date: Tue, 28 Jan 2020 10:41:29 +0100 Subject: [PATCH 1/2] Set default context variable to -k --insecure option --- check_http_json.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/check_http_json.py b/check_http_json.py index 94f4fac..55ec739 100755 --- a/check_http_json.py +++ b/check_http_json.py @@ -683,6 +683,8 @@ if __name__ == "__main__" and len(sys.argv) >= 2 and sys.argv[1] == 'UnitTest': if __name__ == "__main__": args = parseArgs() nagios = NagiosHelper() + context = None + if args.version: print('Version: %s - Date: %s' % (__version__, __version_date__)) exit(0) From 209aaef04189f04d5d1e2126234f497790e0388b Mon Sep 17 00:00:00 2001 From: Markus Opolka Date: Tue, 28 Jan 2020 10:42:22 +0100 Subject: [PATCH 2/2] Fix inconsistent use of tabs/spaces --- check_http_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_http_json.py b/check_http_json.py index 55ec739..d743e6b 100755 --- a/check_http_json.py +++ b/check_http_json.py @@ -755,7 +755,7 @@ if __name__ == "__main__": else: response = urllib2.urlopen(req, context=context) - json_data = response.read() + json_data = response.read() except HTTPError as e: nagios.append_unknown(" HTTPError[%s], url:%s" % (str(e.code), url))