Module: check_mk
Branch: master
Commit: 4186784ff1036df51407689cbda62108b95641a6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4186784ff1036d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Apr 4 08:17:42 2017 +0200
Cleaned up edition detection in sidebar
Change-Id: Ia0580f988848ff2ce06b2f7c30a8768a2dc640d0
---
web/htdocs/sidebar.py | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index 252ab22..ba48b4c 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -190,11 +190,16 @@ def save_user_config(user_config):
def get_check_mk_edition_title():
- version_link = os.readlink("%s/version" % cmk.paths.omd_root)
- if version_link.endswith(".cee.demo"):
- return "Enterprise (Demo)"
- elif "cee" in version_link:
- return "Enterprise"
+ import cmk
+ if cmk.is_enterprise_edition():
+ if cmk.is_demo():
+ return "Enterprise (Demo)"
+ else:
+ return "Enterprise"
+
+ elif cmk.is_managed_edition():
+ return "Managed"
+
else:
return "Raw"