Module: check_mk
Branch: master
Commit: 173fe0a8b5e1cb23106412c10be8e2a9f8ee7c8b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=173fe0a8b5e1cb…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Aug 19 16:07:26 2015 +0200
#2539 FIX Fix impossibility of removing a status host from an existing site configuration
---
.werks/2539 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 6 ++++--
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/.werks/2539 b/.werks/2539
new file mode 100644
index 0000000..7a5faa6
--- /dev/null
+++ b/.werks/2539
@@ -0,0 +1,10 @@
+Title: Fix impossibility of removing a status host from an existing site configuration
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1439993222
+
+
diff --git a/ChangeLog b/ChangeLog
index bab6d11..ee1d393 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -175,6 +175,7 @@
* 2407 FIX: WATO master/slave replication: fixed problem where the configuration from
the master site was not activate on slave site...
* 2474 FIX: Fixed possible corruption of user datasets (contact, mail, rbn
config)...
* 2499 FIX: Git: Fixed message "Please tell me who you are. Run git config
..." on making changes...
+ * 2539 FIX: Fix impossibility of removing a status host from an existing site
configuration
Notifications:
* 2478 Integrated notification plugin for mobile phone push messages via Pushover...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 752035c..38bb3f6 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -10568,7 +10568,7 @@ def mode_sites(phase):
html.write(socket)
# Status host
- if "status_host" in site:
+ if site.get("status_host"):
sh_site, sh_host = site["status_host"]
table.cell(_("Status host"), "%s/%s" % (sh_site,
sh_host))
else:
@@ -10879,6 +10879,8 @@ def mode_edit_site(phase):
if not sh_host:
raise MKUserError("sh_host", _("Please specify the name of
the status host."))
new_site["status_host"] = ( sh_site, sh_host )
+ else:
+ new_site["status_host"] = None
# Replication
repl = html.var("replication")
@@ -11192,7 +11194,7 @@ def create_nagvis_backends(sites):
'socket="%s"' % socket,
]
- if 'status_host' in site:
+ if site.get("status_host"):
cfg.append('statushost="%s"' %
':'.join(site['status_host']))
file('%s/etc/nagvis/conf.d/cmk_backends.ini.php' % defaults.omd_root,
'w').write('\n'.join(cfg))