Module: check_mk
Branch: master
Commit: 7aa0a2e96f9964a5ec1d681fb8be76e38c7e5e7d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7aa0a2e96f9964…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 20 14:45:51 2019 +0100
7176 FIX Fixed "insecure request warning" message during distributed site remote
calls
When executing a remote automation call, for example to rename a host on a remote site
in distributed setups, the message "InsecureRequestWarning: Unverified HTTPS request
is
being made" could be visible in the background job output which we don't want to
display
there. Insecure configurations are made visibile in the analyze configuration results
instead.
Change-Id: I3e3b3405de3ee42807b65f45077dcefb4b56d455
---
.werks/7176 | 15 +++++++++++++++
cmk/gui/plugins/wato/ac_tests.py | 5 +++++
cmk/gui/watolib/__init__.py | 5 +++++
cmk/gui/watolib/automations.py | 5 +++++
4 files changed, 30 insertions(+)
diff --git a/.werks/7176 b/.werks/7176
new file mode 100644
index 0000000..ecd3ede
--- /dev/null
+++ b/.werks/7176
@@ -0,0 +1,15 @@
+Title: Fixed "insecure request warning" message during distributed site remote
calls
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1550666883
+
+When executing a remote automation call, for example to rename a host on a remote site
+in distributed setups, the message "InsecureRequestWarning: Unverified HTTPS request
is
+being made" could be visible in the background job output which we don't want to
display
+there. Insecure configurations are made visibile in the analyze configuration results
+instead.
diff --git a/cmk/gui/plugins/wato/ac_tests.py b/cmk/gui/plugins/wato/ac_tests.py
index 8ba8e18..ec191fb 100644
--- a/cmk/gui/plugins/wato/ac_tests.py
+++ b/cmk/gui/plugins/wato/ac_tests.py
@@ -28,6 +28,7 @@ import abc
import subprocess
import requests
+import urllib3
import cmk.gui.userdb as userdb
import cmk.gui.sites as sites
@@ -50,6 +51,10 @@ from cmk.gui.plugins.wato import (
SiteBackupJobs,
)
+# Disable python warnings in background job output or logs like "Unverified
+# HTTPS request is being made". We warn the user using analyze configuration.
+urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
+
@ac_test_registry.register
class ACTestPersistentConnections(ACTest):
diff --git a/cmk/gui/watolib/__init__.py b/cmk/gui/watolib/__init__.py
index 16d377f..a105506 100644
--- a/cmk/gui/watolib/__init__.py
+++ b/cmk/gui/watolib/__init__.py
@@ -53,6 +53,7 @@ import traceback
from typing import NamedTuple, List # pylint: disable=unused-import
import requests
+import urllib3
from pathlib2 import Path
import six
@@ -305,6 +306,10 @@ import cmk.gui.plugins.watolib
if not cmk.is_raw_edition():
import cmk.gui.cee.plugins.watolib
+# Disable python warnings in background job output or logs like "Unverified
+# HTTPS request is being made". We warn the user using analyze configuration.
+urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
+
def load_watolib_plugins():
cmk.gui.utils.load_web_plugins("watolib", globals())
diff --git a/cmk/gui/watolib/automations.py b/cmk/gui/watolib/automations.py
index 783a013..3f4150e 100644
--- a/cmk/gui/watolib/automations.py
+++ b/cmk/gui/watolib/automations.py
@@ -32,6 +32,7 @@ import re
import subprocess
import time
import requests
+import urllib3
import cmk.utils
@@ -48,6 +49,10 @@ from cmk.gui.exceptions import (
MKUserError,
)
+# Disable python warnings in background job output or logs like "Unverified
+# HTTPS request is being made". We warn the user using analyze configuration.
+urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
+
class MKAutomationException(MKGeneralException):
pass