Module: check_mk
Branch: master
Commit: 957e40b258f68d4924626fe98775ca55ca812f70
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=957e40b258f68d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Feb 21 16:06:10 2017 +0100
werk tool: Related edition is now stored in werks
Change-Id: I8ddd6264ad9acbc829ea01629b3b2c016c5025dd
---
.werks/config | 38 ++++++++++++++++++++++++++++----------
lib/werks.py | 8 ++++----
werk | 33 +++++++++++++++++++++------------
3 files changed, 53 insertions(+), 26 deletions(-)
diff --git a/.werks/config b/.werks/config
index 057edee..b464e33 100644
--- a/.werks/config
+++ b/.werks/config
@@ -1,6 +1,12 @@
+editions = [
+ ( "cre", "Raw Edition" ),
+ ( "cee", "Enterprise Edition" ),
+ ( "cme", "Managed Service Edition" ),
+]
+
components = [
- ( "core", "Core & Setup" ),
- ( "checks", "Checks & Agents" ),
+ ( "core", "Core & setup" ),
+ ( "checks", "Checks & agents" ),
( "multisite", "Multisite" ),
( "wato", "WATO" ),
( "notifications", "Notifications" ),
@@ -8,20 +14,32 @@ components = [
( "reporting", "Reporting & Availability" ),
( "ec", "Event Console" ),
( "livestatus", "Livestatus" ),
- ( "liveproxy", "Livestatus-Proxy" ),
- ( "inv", "HW/SW-Inventory" ),
+ ( "liveproxy", "Livestatus Proxy" ),
+ ( "inv", "HW/SW Inventory" ),
]
+edition_components = {
+ "cee": [
+ ( "cmc", "The Check_MK Micro Core" ),
+ ( "setup", "Setup, site management" ),
+ ( "config", "Configuration generation" ),
+ ( "inline-snmp", "Inline SNMP" ),
+ ( "agents", "Agent bakery" ),
+ ( "metrics", "Metrics system" ),
+ ( "alerts", "Alert handlers" ),
+ ],
+}
+
classes = [
- ( "feature", "New Feature", "" ),
- ( "fix", "Bug Fix", "FIX" ),
- ( "security", "Security Fix", "SEC" ),
+ ( "feature", "New feature", "" ),
+ ( "fix", "Bug fix", "FIX" ),
+ ( "security", "Security fix", "SEC" ),
]
levels = [
- ( '1', "Trivial Change" ),
- ( '2', "Non-Trivial Change" ),
- ( '3', "Major New Feature" ),
+ ( '1', "Trivial change" ),
+ ( '2', "Prominent change" ),
+ ( '3', "Major change" ),
]
compatible = [
diff --git a/lib/werks.py b/lib/werks.py
index 1d0c41a..7f215cf 100644
--- a/lib/werks.py
+++ b/lib/werks.py
@@ -46,9 +46,9 @@ except NameError:
def werk_classes():
return {
- "feature" : _("New Feature"),
- "fix" : _("Bug Fix"),
- "security" : _("Security Fix"),
+ "feature" : _("New feature"),
+ "fix" : _("Bug fix"),
+ "security" : _("Security fix"),
}
@@ -68,7 +68,7 @@ def werk_components():
"inv" : _("HW/SW inventory"),
# CEE
- "cmc" : _("The Check_MK micro core"),
+ "cmc" : _("The Check_MK Micro Core"),
"setup" : _("Setup, site management"),
"config" : _("Configuration generation"),
"inline-snmp" : _("Inline SNMP"),
diff --git a/werk b/werk
index 495530f..627749d 100755
--- a/werk
+++ b/werk
@@ -114,15 +114,6 @@ def load_current_version():
bail_out("Failed to read VERSION from Makefile")
-def component_sort_key(comp):
- for nr, component in enumerate(components):
- if comp == component[0]:
- return nr
- return len(components)
-
-
-
-
def check_modified():
global g_modified
g_modified = set([])
@@ -145,6 +136,7 @@ def load_werk(werkid):
"title" : "unknown",
"component" : "general",
"compatible" : "compat",
+ "edition" : "cre",
}
f = file(str(werkid))
@@ -278,10 +270,11 @@ def list_werk(werk):
bold = ""
lines, cols = get_tty_size()
title = werk["title"][:cols - 45]
- sys.stdout.write("#%04d %-9s %s %-13s %-6s %s%s%s %-8s %s%s%s\n" %
+ sys.stdout.write("#%04d %-9s %s %3s %-13s %-6s %s%s%s %-8s %s%s%s\n" %
(int(werk["id"]),
time.strftime("%F", time.localtime(int(werk["date"]))),
colored_class(werk["class"], 8),
+ werk["edition"],
werk["component"],
werk["compatible"],
tty_bold, werk["level"], tty_normal,
@@ -315,6 +308,7 @@ def main_list(args, format):
hit = False
for tp, values in [
+ ( "edition", editions ),
( "component", components ),
( "level", levels ),
( "class", classes ),
@@ -333,7 +327,7 @@ def main_list(args, format):
if hit:
break
if not hit:
- bail_out("No such component, state, class or target version: %s" %
a)
+ bail_out("No such edition, component, state, class or target version:
%s" % a)
# Filter
newwerks = []
@@ -473,6 +467,11 @@ def input_choice(what, choices):
else:
sys.stdout.write("\n")
+
+def get_edition_components(edition):
+ return components + edition_components.get(edition, [])
+
+
def main_new(args):
werk = {}
werk["id"] = next_werk_id()
@@ -483,7 +482,8 @@ def main_new(args):
sys.stderr.write("Cancelled.\n")
sys.exit(0)
werk["class"] = input_choice("Class", classes)
- werk["component"] = input_choice("Component", components)
+ werk["edition"] = input_choice("Edition", editions)
+ werk["component"] = input_choice("Component",
get_edition_components(werk["edition"]))
werk["level"] = input_choice("Level", levels)
werk["compatible"] = input_choice("Compatible", compatible)
werk["description"] = u"\n"
@@ -761,6 +761,15 @@ def main_fetch_ids(args):
# |_| |_| |_|\__,_|_|_| |_|
#
+# default config
+editions = []
+components = []
+edition_components = {}
+classes = []
+levels = []
+compatible = []
+online_url = None
+
versions = set([])
goto_werksdir()
load_config()