From a02717a8c02356103e0e10af08d9ae05b92d8106 Mon Sep 17 00:00:00 2001 From: Ramy Asselin Date: Wed, 18 Nov 2015 10:01:38 -0800 Subject: [PATCH] Disable InsecurePlatform Warnings These warnings are filling up log files. Just disable them. Change-Id: I906a03830a619e757842711e1044d8f65e24c2b5 --- elastic_recheck/cmd/graph.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/elastic_recheck/cmd/graph.py b/elastic_recheck/cmd/graph.py index 7f66e8d7..135a63e6 100755 --- a/elastic_recheck/cmd/graph.py +++ b/elastic_recheck/cmd/graph.py @@ -25,6 +25,18 @@ from launchpadlib import launchpad import pytz import requests +try: + # Disable InsecurePlatformWarning warnings as documented here + # https://github.com/kennethreitz/requests/issues/2214 + from requests.packages.urllib3.exceptions import InsecurePlatformWarning + requests.packages.urllib3.disable_warnings(InsecurePlatformWarning) +except ImportError: + # If there's an import error, then urllib3 may be packaged + # separately, so apply it there too + import urllib3 + from urllib3.exceptions import InsecurePlatformWarning + urllib3.disable_warnings(InsecurePlatformWarning) + import elastic_recheck.elasticRecheck as er from elastic_recheck import log as logging import elastic_recheck.query_builder as qb