Module: check_mk
Branch: master
Commit: be32161cc5faebbe63431f74cb7ba8a8557c53a4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=be32161cc5faeb…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Apr 5 12:40:41 2016 +0200
3359 FIX Fixed exception when trying to edit non existant host
Fixed the exception "local variable 'folder' referenced before
assignment".
---
.werks/3359 | 10 ++++++++++
ChangeLog | 2 +-
web/htdocs/watolib.py | 3 +--
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/.werks/3359 b/.werks/3359
new file mode 100644
index 0000000..e0c0f15
--- /dev/null
+++ b/.werks/3359
@@ -0,0 +1,10 @@
+Title: Fixed exception when trying to edit non existant host
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1459852710
+
+Fixed the exception "local variable 'folder' referenced before
assignment".
diff --git a/ChangeLog b/ChangeLog
index 4163396..ff40508 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,7 +13,6 @@
* 3343 FIX: MKP: Verifying minimal version of packages during installation...
* 3349 FIX: Added rule to disable Inline-SNMP per host...
-
Checks & Agents:
* 3183 aruba_wlc_aps: new check which monitors the provisioned accesspoints of an
Aruba Network WLAN Controller
* 3184 varnish, varnish.backend, varnish.backend_success_ratio, varnish.cache,
varnish.cache_hit_ratio, varnish.client, varnish.esi, varnish.fetch, varnish.objects,
varnish.worker, varnish.worker_thread_ratio: new checks which monitor HTTP Accelerator
Statistics via varnishstat on Linux
@@ -210,6 +209,7 @@
* 3353 FIX: Displaying disabled/offline host state in WATO host list now
* 3354 FIX: Added missing option to exclude IP addresses by regex
* 3357 FIX: Fixed service conditions of Disk IO related rulesets
+ * 3359 FIX: Fixed exception when trying to edit non existant host...
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 277a1a3..5b091ff 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -640,12 +640,11 @@ class Folder(BaseFolder):
folder = Folder.folder(html.var("folder"))
else:
host_name = html.var("host")
+ folder = Folder.root_folder()
if host_name: # find host with full scan. Expensive operation
host = Host.host(host_name)
if host:
folder = host.folder()
- else:
- folder = Folder.root_folder()
Folder.set_current(folder)
return folder