Module: check_mk
Branch: master
Commit: 752e34be50a2c06c14d37fbdb2c5036a13aba5ee
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=752e34be50a2c0…
Author: Andreas <ab(a)mathias-kettner.de>
Date: Mon Jun 18 11:37:29 2018 +0200
5825 FIX Fixed broken sync of personal user settings information to slave sites
Werk 6053 broke synchronisation of personal user settings to slave sites. This has been fixed.
Note: The personal user settings are also synced during "Activate changes".
So they are synced after all - just a bit delayed.
Change-Id: I3dce9282508e343f2558fec527ab93642ccb5de2
---
.werks/5825 | 16 ++++++++++++++++
web/htdocs/wato.py | 3 ++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/.werks/5825 b/.werks/5825
new file mode 100644
index 0000000..2a820d3
--- /dev/null
+++ b/.werks/5825
@@ -0,0 +1,16 @@
+Title: Fixed broken sync of personal user settings information to slave sites
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1529314447
+
+Werk 6053 broke synchronisation of personal user settings to slave sites. This has been fixed.
+
+Note: The personal user settings are also synced during "Activate changes".
+So they are synced after all - just a bit delayed.
+
+
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 1254259..d908860 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -14927,7 +14927,8 @@ def user_profile_async_replication_page():
html.context_button(_('User Profile'), 'user_profile.py', 'back')
html.end_context_buttons()
- user_profile_async_replication_dialog(sites=config.user.authorized_login_sites())
+ sites = [site_id for site_id, site in config.user.authorized_login_sites()]
+ user_profile_async_replication_dialog(sites=sites)
html.footer()
Module: check_mk
Branch: master
Commit: 5fca19495a88bf8545335317f85015d0d219584c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5fca19495a88bf…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Jun 15 12:04:16 2018 +0200
6013 FIX Correctly ignore downtimes for vanished hosts/services.
Restarting the CMC while a downtime is active for a vanished host/service
could lead to a crash. This has been fixed.
Change-Id: Iab4e4992e7b850f8b900d090c708763209a9c338
---
.werks/6013 | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/.werks/6013 b/.werks/6013
new file mode 100644
index 0000000..1ba931b
--- /dev/null
+++ b/.werks/6013
@@ -0,0 +1,11 @@
+Title: Correctly ignore downtimes for vanished hosts/services.
+Level: 1
+Component: core
+Compatible: compat
+Edition: cee
+Version: 1.6.0i1
+Date: 1529057022
+Class: fix
+
+Restarting the CMC while a downtime is active for a vanished host/service
+could lead to a crash. This has been fixed.
Module: check_mk
Branch: master
Commit: 62711ab20a8b6588915e841aef59a871e56cbb82
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=62711ab20a8b65…
Author: Andreas <ab(a)mathias-kettner.de>
Date: Fri Jun 15 11:50:46 2018 +0200
5824 FIX Agent Bakery: Fixed missing baked packages
During the agent bake process some previously generated symlinks went missing.
The baking itself went fine, but the symlinks pointing to the bake result were no longer available.
As a result, the agent bakery GUI showed some packages as "Not available".
This is a preliminary fix, until we find the root cause of this problem.
There is also a console woraround for this problem.
Agent baking will always work with the command <tt>cmk -v --bake-agents</tt>
Change-Id: I5fc7365e4c95d791d9f8b32fdb2ec58f058914b4
---
.werks/5824 | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/.werks/5824 b/.werks/5824
new file mode 100644
index 0000000..1d1fa13
--- /dev/null
+++ b/.werks/5824
@@ -0,0 +1,18 @@
+Title: Agent Bakery: Fixed missing baked packages
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cee
+State: unknown
+Version: 1.6.0i1
+Date: 1529055871
+
+During the agent bake process some previously generated symlinks went missing.
+The baking itself went fine, but the symlinks pointing to the bake result were no longer available.
+As a result, the agent bakery GUI showed some packages as "Not available".
+This is a preliminary fix, until we find the root cause of this problem.
+
+There is also a console workaround for this problem.
+Agent baking will always succeed with the command <tt>cmk -v --bake-agents</tt>
+Keep in mind, that you need to sign the agents afterwards.
Module: check_mk
Branch: master
Commit: 646f42798d4e852e84e68d121ea6752f1c2c0294
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=646f42798d4e85…
Author: Andreas Umbreit <au(a)mathias-kettner.de>
Date: Thu May 17 10:07:09 2018 +0200
CMK-538: Support multiple folders in Agent Bakery Host Selection
- Refactor FolderChoice factory function from wato.py to real valuespec
in valuespec.py
- Create/Adapt functions that provide a list of multiple folders
including a convenient presentation of their full paths, create a
FullPathFolderChoice valuespec upon them
- Adapt selection for Agent Bakery Host Selection rule and wrap it with
a Transform-Valuespec for proper porting of old configs
Change-Id: Ibb6fa6fbc55260a5b1dff2f2688ff34d6c1b49ac
---
web/htdocs/valuespec.py | 14 ++++++
web/htdocs/wato.py | 124 +++++++++++++++++++++++++++++++-----------------
web/htdocs/watolib.py | 22 ++++++---
3 files changed, 111 insertions(+), 49 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 12d2c4e..720fcaa 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1709,6 +1709,20 @@ class DropdownChoice(ValueSpec):
return True
+class FolderChoice(DropdownChoice):
+ def __init__(self, **kwargs):
+ import watolib
+ kwargs["choices"] = watolib.Folder.folder_choices
+ kwargs.setdefault("title", _("Folder"))
+ DropdownChoice.__init__(self, **kwargs)
+
+class FullPathFolderChoice(DropdownChoice):
+ def __init__(self, **kwargs):
+ import watolib
+ kwargs["choices"] = watolib.Folder.folder_choices_fulltitle
+ kwargs.setdefault("title", _("Folder"))
+ DropdownChoice.__init__(self, **kwargs)
+
# Special conveniance variant for monitoring states
# TODO: Rename to ServiceState() or something like this
class MonitoringState(DropdownChoice):
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 5c78e66..1254259 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -7907,13 +7907,6 @@ class CheckTypeGroupSelection(ElementSelection):
return "<tt>%s</tt>" % value
-
-def FolderChoice(**kwargs):
- kwargs["choices"] = lambda: watolib.Folder.folder_choices()
- kwargs.setdefault("title", _("Folder"))
- return DropdownChoice(**kwargs)
-
-
def vs_notification_bulkby():
return ListChoice(
title = _("Create separate notification bulks based on"),
@@ -8185,54 +8178,99 @@ def vs_notification_rule(userid = None):
)
-def simple_host_rule_match_conditions():
- return [
- ( "match_site",
- DualListChoice(
- title = _("Match site"),
- help = _("This condition makes the rule match only hosts of "
- "the selected sites."),
- choices = config.site_attribute_choices,
- ),
+def site_rule_match_condition():
+ return (
+ "match_site",
+ DualListChoice(
+ title = _("Match site"),
+ help = _("This condition makes the rule match only hosts of "
+ "the selected sites."),
+ choices = config.site_attribute_choices,
),
- ( "match_folder",
- FolderChoice(
- title = _("Match folder"),
- help = _("This condition makes the rule match only hosts that are managed "
- "via WATO and that are contained in this folder - either directly "
- "or in one of its subfolders."),
- ),
+ )
+
+
+def single_folder_rule_match_condition():
+ return (
+ "match_folder",
+ FolderChoice(
+ title = _("Match folder"),
+ help = _("This condition makes the rule match only hosts that are managed "
+ "via WATO and that are contained in this folder - either directly "
+ "or in one of its subfolders."),
+ ),
+ )
+
+
+def multi_folder_rule_match_condition():
+ return (
+ "match_folders",
+ ListOf(
+ FullPathFolderChoice(
+ title = _("Folder"),
+ help = _("This condition makes the rule match only hosts that are managed "
+ "via WATO and that are contained in this folder - either directly "
+ "or in one of its subfolders."),
+ ),
+ add_label = _("Add additional folder"),
+ title = _("Match folders"),
+ movable = False
),
+ )
+
+
+def common_host_rule_match_conditions():
+ return [
( "match_hosttags",
- watolib.HostTagCondition(
- title = _("Match Host Tags"))
+ watolib.HostTagCondition(
+ title = _("Match Host Tags"))
),
( "match_hostgroups",
- userdb.GroupChoice("host",
- title = _("Match Host Groups"),
- help = _("The host must be in one of the selected host groups"),
- allow_empty = False,
- )
+ userdb.GroupChoice("host",
+ title = _("Match Host Groups"),
+ help = _("The host must be in one of the selected host groups"),
+ allow_empty = False,
+ )
),
( "match_hosts",
- ListOfStrings(
- title = _("Match only the following hosts"),
- size = 24,
- orientation = "horizontal",
- allow_empty = False,
- empty_text = _("Please specify at least one host. Disable the option if you want to allow all hosts."),
- )
+ ListOfStrings(
+ title = _("Match only the following hosts"),
+ size = 24,
+ orientation = "horizontal",
+ allow_empty = False,
+ empty_text = _("Please specify at least one host. Disable the option if you want to allow all hosts."),
+ )
),
( "match_exclude_hosts",
- ListOfStrings(
- title = _("Exclude the following hosts"),
- size = 24,
- orientation = "horizontal",
- )
- ),
+ ListOfStrings(
+ title = _("Exclude the following hosts"),
+ size = 24,
+ orientation = "horizontal",
+ )
+ )
]
+def simple_host_rule_match_conditions():
+ return [
+ site_rule_match_condition(),
+ single_folder_rule_match_condition()
+ ] + common_host_rule_match_conditions()
+
+
+def multifolder_host_rule_match_conditions():
+ return [
+ site_rule_match_condition(),
+ multi_folder_rule_match_condition()
+ ] + common_host_rule_match_conditions()
+
+
+def transform_simple_to_multi_host_rule_match_conditions(value):
+ if value and "match_folder" in value:
+ value["match_folders"] = [value.pop("match_folder")]
+ return value
+
+
def generic_rule_match_conditions():
return simple_host_rule_match_conditions() + [
( "match_servicegroups",
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 655cdc9..a570767 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -1130,6 +1130,11 @@ class CREFolder(BaseFolder):
@staticmethod
+ def folder_choices_fulltitle():
+ return Folder.root_folder().recursive_subfolder_choices(current_depth=0, pretty=False)
+
+
+ @staticmethod
def folder(folder_path):
if folder_path in Folder.all_folders():
return Folder.all_folders()[folder_path]
@@ -1811,15 +1816,20 @@ class CREFolder(BaseFolder):
return choices
- def recursive_subfolder_choices(self, current_depth=0):
- if current_depth:
- title_prefix = (u"\u00a0" * 6 * current_depth) + u"\u2514\u2500 "
+ def recursive_subfolder_choices(self, current_depth=0, pretty=True):
+ if pretty:
+ if current_depth:
+ title_prefix = (u"\u00a0" * 6 * current_depth) + u"\u2514\u2500 "
+ else:
+ title_prefix = ""
+ title = HTML(title_prefix + html.attrencode(self.title()))
else:
- title_prefix = ""
- sel = [ (self.path(), HTML(title_prefix + html.attrencode(self.title()))) ]
+ title = HTML(html.attrencode("/".join(self.title_path_without_root())))
+
+ sel = [(self.path(), title)]
for subfolder in self.visible_subfolders_sorted_by_title():
- sel += subfolder.recursive_subfolder_choices(current_depth + 1)
+ sel += subfolder.recursive_subfolder_choices(current_depth + 1, pretty)
return sel