[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#910719: stretch-pu: package nagstamon/2.0.1-5+deb9u1



Package: release.debian.org
Severity: normal
Tags: stretch
User: release.debian.org@packages.debian.org
Usertags: pu

Hi SRM,

[Cc'ed Moritz Schlarb <moschlar@metalabs.de>]

When configuring a server using the monitoring type set to IcingaWeb2
and using basic authetication, then nagstamon will crash with

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/Nagstamon/QUI/__init__.py", line 3538, in get_status
    status = self.server.GetStatus()
  File "/usr/lib/python3/dist-packages/Nagstamon/Servers/Generic.py", line 798, in GetStatus
    self.init_HTTP()
  File "/usr/lib/python3/dist-packages/Nagstamon/Servers/IcingaWeb2.py", line 99, in init_HTTP
    form_inputs[form_input] = form.find('input', {'name': form_input})['value']
TypeError: 'NoneType' object is not subscriptable
Aborted

Filled as #910717 for this tracking.

This was adressed with
https://github.com/HenriWahl/Nagstamon/commit/907b69a999fc73e371369ff7512531296fad32e0
and the fix already included in unstable.

Attached is the debdiff tested for a respective configured instance.

Regards,
Salvatore
diff -Nru nagstamon-2.0.1/debian/changelog nagstamon-2.0.1/debian/changelog
--- nagstamon-2.0.1/debian/changelog	2017-05-03 14:55:30.000000000 +0200
+++ nagstamon-2.0.1/debian/changelog	2018-10-10 09:39:44.000000000 +0200
@@ -1,3 +1,13 @@
+nagstamon (2.0.1-5+deb9u1) stretch; urgency=medium
+
+  * Non-maintainer upload.
+  * Address IcingaWeb2 Basic auth issue.
+    Configuring a server with monitoring type "IcingaWeb2" using Basic
+    authentication crashes nagstamon with "TypeError: NoneType object is not
+    subscriptable". (Closes: #910717)
+
+ -- Salvatore Bonaccorso <carnil@debian.org>  Wed, 10 Oct 2018 09:39:44 +0200
+
 nagstamon (2.0.1-5) unstable; urgency=medium
 
   * Don't disable InsecureRequestWarning warnings from urllib3 
diff -Nru nagstamon-2.0.1/debian/patches/series nagstamon-2.0.1/debian/patches/series
--- nagstamon-2.0.1/debian/patches/series	2017-05-03 14:55:30.000000000 +0200
+++ nagstamon-2.0.1/debian/patches/series	2018-10-10 09:35:34.000000000 +0200
@@ -3,3 +3,4 @@
 no-QtCore-in-setup-py.patch
 spelling-error-in-manpage.patch
 fix-duplicated-compressed-file.patch
+try-to-fix-IcingaWeb2-Basic-auth-bug.patch
diff -Nru nagstamon-2.0.1/debian/patches/try-to-fix-IcingaWeb2-Basic-auth-bug.patch nagstamon-2.0.1/debian/patches/try-to-fix-IcingaWeb2-Basic-auth-bug.patch
--- nagstamon-2.0.1/debian/patches/try-to-fix-IcingaWeb2-Basic-auth-bug.patch	1970-01-01 01:00:00.000000000 +0100
+++ nagstamon-2.0.1/debian/patches/try-to-fix-IcingaWeb2-Basic-auth-bug.patch	2018-10-10 09:39:44.000000000 +0200
@@ -0,0 +1,29 @@
+From: Henri Wahl <h.wahl@ifw-dresden.de>
+Date: Thu, 20 Jul 2017 12:10:11 +0200
+Subject: try to fix IcingaWeb2 Basic auth bug
+Origin: https://github.com/HenriWahl/Nagstamon/commit/907b69a999fc73e371369ff7512531296fad32e0
+Bug-Debian: https://bugs.debian.org/910717
+
+---
+ Nagstamon/Servers/IcingaWeb2.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/Nagstamon/Servers/IcingaWeb2.py b/Nagstamon/Servers/IcingaWeb2.py
+index 86f909cc4f1d..101667d319ba 100644
+--- a/Nagstamon/Servers/IcingaWeb2.py
++++ b/Nagstamon/Servers/IcingaWeb2.py
+@@ -96,7 +96,10 @@ class IcingaWeb2Server(GenericServer):
+                     form = login.result.find('form')
+                     form_inputs = {}
+                     for form_input in ('redirect', 'formUID', 'CSRFToken', 'btn_submit'):
+-                        form_inputs[form_input] = form.find('input', {'name': form_input})['value']
++                        if not form.find('input', {'name': form_input}) is None:
++                            form_inputs[form_input] = form.find('input', {'name': form_input})['value']
++                        else:
++                            form_inputs[form_input] = ''
+                     form_inputs['username'] = self.username
+                     form_inputs['password'] = self.password
+     
+-- 
+2.11.0
+

Reply to: