Merge "disable urllib3 warnings only if the library provide them"
This commit is contained in:
commit
e811456c7b
@ -504,10 +504,12 @@ def run(argv, categories):
|
|||||||
urllib3_log.setLevel(logging.WARNING)
|
urllib3_log.setLevel(logging.WARNING)
|
||||||
|
|
||||||
LOG.debug("urllib3 insecure warnings are hidden.")
|
LOG.debug("urllib3 insecure warnings are hidden.")
|
||||||
urllib3.disable_warnings(
|
for warning in ("InsecurePlatformWarning",
|
||||||
urllib3.exceptions.InsecurePlatformWarning)
|
"SNIMissingWarning",
|
||||||
urllib3.disable_warnings(urllib3.exceptions.SNIMissingWarning)
|
"InsecureRequestWarning"):
|
||||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
warning_cls = getattr(urllib3.exceptions, warning, None)
|
||||||
|
if warning_cls is not None:
|
||||||
|
urllib3.disable_warnings(warning_cls)
|
||||||
|
|
||||||
# NOTE(wtakase): This is for suppressing boto error logging.
|
# NOTE(wtakase): This is for suppressing boto error logging.
|
||||||
LOG.debug("ERROR log from boto module is hide.")
|
LOG.debug("ERROR log from boto module is hide.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user