Module: check_mk
Branch: master
Commit: cc51b697b3c261da78d852932ea2b42eb616156d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cc51b697b3c261…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue May 23 11:22:35 2017 +0200
CME: Resolve circular dependencies with CME submodules of watolib
Change-Id: I1e7944e26f2a623b2ab7a6f4340be3deef5cfa6e
---
web/htdocs/watolib.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 8b3c589..7f9a915 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -66,7 +66,6 @@ import cmk.render as render
if cmk.is_managed_edition():
import managed
- import managed_snapshots
replication_paths = []
backup_paths = []
@@ -2492,10 +2491,11 @@ class CREHost(WithPermissionsAndAttributes):
if cmk.is_managed_edition():
- # TODO: watolib -> import managed_watolib -> import watolib !
- import managed_watolib
- Folder = managed_watolib.CMEFolder
- Host = managed_watolib.CMEHost
+ # TODO: Hack that is needed to resolve circular imports. This will be cleaned up in
1.5 code
+ # soon. For the 1.4. we need to stick with this hack. Sorry.
+ execfile("%s/plugins/watolib/managed_watolib.py" % cmk.paths.web_dir)
+ Folder = CMEFolder
+ Host = CMEHost
else:
Folder = CREFolder
Host = CREHost
@@ -4428,6 +4428,7 @@ class ActivateChangesManager(ActivateChanges):
finally:
if cmk.is_managed_edition():
# Discards any data which was shared during the snapshot creation
+ import managed_snapshots
managed_snapshots.CMESnapshot.discard_cached_data()
unlock_exclusive()
@@ -4473,6 +4474,7 @@ class ActivateChangesManager(ActivateChanges):
replicate_components.add("mkps")
if cmk.is_managed_edition():
+ import managed_snapshots
snapshot = managed_snapshots.CMESnapshot(site_id, site_tmp_dir,
replicate_components)
snapshot.create_site_snapshot()