Module: check_mk
Branch: master
Commit: 94e9374cc962bf5040dd8b048b8b8555d9421419
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=94e9374cc962bf…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 17 14:26:24 2016 +0100
#3225 FIX Fixed exception when renaming a host which is configured as parent on a folder
---
.werks/3225 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 2 +-
web/htdocs/watolib.py | 4 ++--
4 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/.werks/3225 b/.werks/3225
new file mode 100644
index 0000000..afc5e54
--- /dev/null
+++ b/.werks/3225
@@ -0,0 +1,10 @@
+Title: Fixed exception when renaming a host which is configured as parent on a folder
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1455715567
+
+
diff --git a/ChangeLog b/ChangeLog
index 332a18a..55c4c55 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -43,6 +43,7 @@
* 3216 FIX: Fixed exception when trying to edit an already deleted user
* 3222 FIX: Fixed broken duplicate user id validation when creating new users
* 3223 FIX: Fixed exception in network scan when hosts can not be resolved
+ * 3225 FIX: Fixed exception when renaming a host which is configured as parent on a
folder
Event Console:
* 3058 FIX: Event Console is now allowing non loadable MIB modules on startup...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index c132dd4..610fa5d 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -1744,7 +1744,7 @@ def rename_host_as_parent(oldname, newname, in_folder=None):
if in_folder.has_explicit_attribute("parents"):
if in_folder.rename_parent(oldname, newname):
- parents.append(somehost.name())
+ parents.append(in_folder.name())
if parents:
parents = [ "parents" ] * len(parents)
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index b04283c..b74ebd2 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -1563,8 +1563,8 @@ class Folder(BaseFolder):
# Must not fail because of auth problems. Auth is check at the
# actually renamed host.
changed = rename_host_in_list(self._attributes["parents"], oldname,
newname)
- self.mark_dirty()
- self.folder().save_hosts()
+ self.mark_hosts_dirty()
+ self.save_hosts()
return changed