Module: check_mk
Branch: master
Commit: 766dd018242017fd5bffef74a2bf10317095e76a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=766dd018242017…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Dec 23 14:20:32 2011 +0100
WATO: Prevent erros if no contactgroups defined for a user
---
web/htdocs/wato.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index db7efc3..78170b0 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -921,7 +921,7 @@ def check_folder_permissions(folder, how, exception=True, user = None):
if config.user_id not in users:
user_cgs = []
else:
- user_cgs = users[config.user_id]["contactgroups"]
+ user_cgs = users[config.user_id].get("contactgroups", [])
for c in user_cgs:
if c in cgs:
Module: check_mk
Branch: master
Commit: 3e7222e32cf5160bbb7007bd1535551164f71804
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3e7222e32cf516…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Dec 23 15:06:37 2011 +0100
WATO: bugfix visibility of host tags dropdown menu after POST form
---
web/htdocs/htmllib.py | 2 +-
web/htdocs/wato.py | 10 +++++++---
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 1572a03..faa9d8f 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -445,7 +445,7 @@ class html:
(onchange_code, varname, varname, attributes))
for value, text in options:
if value == None: value = ""
- sel = value.split('|')[0] == current and " selected" or ""
+ sel = value == current and " selected" or ""
self.write("<option value=\"%s\"%s>%s</option>\n" % (value, sel, text))
self.write("</select>\n")
if varname:
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index a39e220..a4d73bf 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -3529,8 +3529,10 @@ class HostTagAttribute(Attribute):
# But case could occur if tags definitions have been changed.
def render_input(self, value):
+ varname = "attr_" + self.name()
if value == None:
- value = "" # Important for tag groups with an empty tag entry
+ value = html.var(varname,"") # "" is important for tag groups with an empty tag entry
+
# Tag groups with just one entry are being displayed
# as checkboxes
choices = []
@@ -3543,9 +3545,11 @@ class HostTagAttribute(Attribute):
else:
secondary_tags = []
choices.append(("|".join([ tagvalue ] + secondary_tags), e[1]))
- varname = "attr_" + self.name()
+ if value != "" and value == tagvalue:
+ value = value + "|" + "|".join(secondary_tags)
+
if len(choices) == 1:
- html.checkbox(varname, value != None, cssclass = '', onclick='wato_fix_visibility();', add_attr = ["tags=%s"%choices[0][0]])
+ html.checkbox(varname, value != "", cssclass = '', onclick='wato_fix_visibility();', add_attr = ["tags=%s"%choices[0][0]])
html.write(" " + choices[0][1])
else:
html.select(varname, choices, value, onchange='wato_fix_visibility();')
Module: check_mk
Branch: master
Commit: a50c0ce69144aa5cf4fbbc70bc8d863eea437db2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a50c0ce69144aa…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Dec 23 13:43:26 2011 +0100
Inventory of SNMP devices: force implicit full scan
---
ChangeLog | 2 ++
web/htdocs/wato.py | 6 ++++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9539d76..46aa366 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,8 @@
* NagVis auhtorization file generation is also executed on activate_changes
* Implemented a new inclusion based API for using multisite permissions
in other addons
+ * Inventory of SNMP devices: force implicit full scan if no services
+ are configured yet
* FIX: Calling activate_changes hook also in distributed WATO setups
* FIX: Fixed javascript errors when doing replication in distributed
wato environments when not having the sidebar open
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index a39e220..db7efc3 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -1833,8 +1833,14 @@ def show_service_table(host, firsttime):
# Read current check configuration
cache_options = not html.var("_scan") and [ '--cache' ] or []
+
+ # We first try using the Cache (if the user has not pressed Full Scan).
+ # If we do not find any data, we omit the cache and immediately try
+ # again without using the cache.
try:
table = check_mk_automation(host[".siteid"], "try-inventory", cache_options + [hostname])
+ if len(table) == 0 and cache_options != []:
+ table = check_mk_automation(host[".siteid"], "try-inventory", [hostname])
except Exception, e:
if config.debug:
raise