Module: check_mk
Branch: master
Commit: 5241b9bae259b6c8e5dc45503d5ebef7b39d892f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5241b9bae259b6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 4 13:12:20 2018 +0100
6921 FIX pushover: Fixed not working proxy setting
The proxy setting of the pushover notification script was not working at all
since its implementation with werk #4592.
Change-Id: Ib229e70d2d4befec323accb775fe85305f032790
---
.werks/6921 | 12 ++++++++++++
cmk/notification_plugins/pushover.py | 8 ++------
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/.werks/6921 b/.werks/6921
new file mode 100644
index 0000000..97eadc9
--- /dev/null
+++ b/.werks/6921
@@ -0,0 +1,12 @@
+Title: pushover: Fixed not working proxy setting
+Level: 1
+Component: notifications
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1543914154
+
+The proxy setting of the pushover notification script was not working at all
+since its implementation with werk #4592.
diff --git a/cmk/notification_plugins/pushover.py b/cmk/notification_plugins/pushover.py
index 17c1fb4..aa458da 100644
--- a/cmk/notification_plugins/pushover.py
+++ b/cmk/notification_plugins/pushover.py
@@ -113,12 +113,8 @@ def send_push_notification(api_key, recipient_key, subject, text,
context):
params.append(("sound", context["PARAMETER_SOUND"]))
s = requests.Session()
- if context.get("PARAMETER_PROXY"):
- if context["PARAMETER_PROXY"].startswith('https'):
- protocol = 'https'
- else:
- protocol = 'http'
- r = s.post(api_url, params=dict(params), proxies={protocol:
context["PARAMETER_PROXY"]})
+ if context.get("PARAMETER_PROXY_URL"):
+ r = s.post(api_url, params=dict(params), proxies={"https":
context["PARAMETER_PROXY_URL"]})
else:
r = s.post(api_url, params=dict(params))