Module: check_mk
Branch: master
Commit: 06e797bef439735ad93a510aa86fae3683ed9c40
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=06e797bef43973…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jun 13 12:07:04 2012 +0200
FIX: set new site dirty is host move due to change of folder attrs
---
.bugs/769 | 7 +++++--
ChangeLog | 2 ++
web/htdocs/wato.py | 10 +++++-----
3 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/.bugs/769 b/.bugs/769
index 85e227c..b155085 100644
--- a/.bugs/769
+++ b/.bugs/769
@@ -1,9 +1,9 @@
Title: Editing folder information does not set site dirty
Component: wato
-State: open
+Class: bug
+State: done
Date: 2012-06-13 11:43:11
Targetversion: 1.2.0
-Class: bug
I did the following:
@@ -17,3 +17,6 @@ I did the following:
--> Slave site is not being set to dirty. Activate changes
leaves you with zero hosts.
+
+2012-06-13 12:06:34: changed state open -> done
+Fixed.
diff --git a/ChangeLog b/ChangeLog
index e27dff7..abbc293 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,8 @@
a topic for "Used rules" - a short overview of all non-empty
rulesets.
* FIX: add missing context help to host details dialog
+ * FIX: set new site dirty is host move due to change of
+ folder attributes
1.2.0p1:
Core:
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 52184dc..35d605f 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -496,7 +496,7 @@ def load_folder(dir, name="", path="",
parent=None, childs = True):
# so that subsequent code has access to the correct folder
# meta data (such as .siteid)
def reload_folder(folder):
- load_folder(folder_dir(folder), folder[".name"], folder[".path"],
folder.get(".parent"))
+ return load_folder(folder_dir(folder), folder[".name"],
folder[".path"], folder.get(".parent"))
# Load the information about all folders - except the hosts
def load_all_folders():
@@ -1664,13 +1664,15 @@ def mode_editfolder(phase, new):
if attributes_changed:
mark_affected_sites_dirty(g_folder)
g_folder["attributes"] = attributes
- mark_affected_sites_dirty(g_folder)
# Due to changes in folder/file attributes, host files
# might need to be rewritten in order to reflect Changes
# in Nagios-relevant attributes.
rewrite_config_files_below(g_folder) # due to inherited attributes
- reload_folder(g_folder)
+ save_folder(g_folder)
+ g_folder = reload_folder(g_folder)
+ mark_affected_sites_dirty(g_folder)
+
log_pending(AFFECTED, g_folder, "edit-folder",
_("Changed attributes of folder %s") % title)
call_hook_hosts_changed(g_folder)
@@ -4623,7 +4625,6 @@ def configure_attributes(hosts, for_what, parent, myself=None,
without_attribute
continue
attrname = attr.name()
if attrname in without_attributes:
- html.debug(without_attributes)
continue # e.g. needed to skip ipaddress in CSV-Import
# Hide invisible attributes
@@ -7003,7 +7004,6 @@ def mark_affected_sites_dirty(folder, hostname=None, sync = True,
restart = True
# "need_restart" : True,
# }
# for site_id, site in sites.items():
-# html.debug("ID: " + site_id)
# update_replication_status(site_id, changes)
def remove_sync_snapshot():