Module: check_mk
Branch: master
Commit: 72abc54164662cdf5552596a552504cf78a65195
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=72abc54164662c…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Feb 22 09:48:08 2018 +0100
5766 FIX Contact groups: Fixed handling of missing inventory paths
Old configurations have not permitted inventory paths configured.
Change-Id: I14bd0cb327220af8c73f669d64b2503d15a1c6e5
---
.werks/5766 | 10 ++++++++++
web/htdocs/inventory.py | 4 ++++
2 files changed, 14 insertions(+)
diff --git a/.werks/5766 b/.werks/5766
new file mode 100644
index 0000000..d51279a
--- /dev/null
+++ b/.werks/5766
@@ -0,0 +1,10 @@
+Title: Contact groups: Fixed handling of missing inventory paths
+Level: 1
+Component: multisite
+Compatible: compat
+Edition: cre
+Version: 1.5.0i4
+Date: 1519289175
+Class: fix
+
+Old configurations have not permitted inventory paths configured.
diff --git a/web/htdocs/inventory.py b/web/htdocs/inventory.py
index 534828f..0eeb521 100644
--- a/web/htdocs/inventory.py
+++ b/web/htdocs/inventory.py
@@ -216,6 +216,10 @@ None in case the user is allowed to see the whole tree.
permitted_paths = []
for user_group in user_groups:
inventory_paths = contact_groups.get(user_group,
{}).get('inventory_paths')
+ if inventory_paths is None:
+ # Old configuration: no paths configured means 'allow_all'
+ return None
+
if inventory_paths == "allow_all":
return None