From b1e0d8a270494b5fc782f11c04d122b8f59292b3 Mon Sep 17 00:00:00 2001 From: Christophe Varoqui Date: Fri, 9 Jun 2023 11:12:56 +0200 Subject: [PATCH] Rename the collector tag commandset options --tag => --name --tag-data => --data --tag-attach-data => --attach-data --- opensvc/commands/node/parser.py | 20 ++++++++++---------- opensvc/commands/svc/parser.py | 20 ++++++++++---------- opensvc/core/collector/actions.py | 12 ++++++------ 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/opensvc/commands/node/parser.py b/opensvc/commands/node/parser.py index 2732e4511..6066dc0d6 100644 --- a/opensvc/commands/node/parser.py +++ b/opensvc/commands/node/parser.py @@ -290,17 +290,17 @@ ":cmd:`om node pushasset --sync` before a compliance run makes sure " "the pushed data has hit the collector database before the " "rulesets are contextualized."), - "tag": Option( - "--tag", default=None, - action="store", dest="tag", + "tag_name": Option( + "--name", default=None, + action="store", dest="name", help="The tag name, as shown by :cmd:`om node collector list tags`."), "tag_data": Option( - "--tag-data", default=None, - action="store", dest="tag_data", + "--data", default=None, + action="store", dest="data", help="The data stored with the tag. Typed tags, like :: expect a particular data structure."), "tag_attach_data": Option( - "--tag-attach-data", default=None, - action="store", dest="tag_attach_data", + "--attach-data", default=None, + action="store", dest="attach_data", help="The data stored with the tag attachment. Typed tags, like :: expect a particular data structure."), "target": Option( "--target", default=None, action="store", dest="target", @@ -992,14 +992,14 @@ "collector_tag_attach": { "msg": "Set a node tag (pointed by --tag).", "options": [ - OPT.tag, + OPT.tag_name, OPT.tag_attach_data, ], }, "collector_tag_detach": { "msg": "Unset a node tag (pointed by --tag).", "options": [ - OPT.tag, + OPT.tag_name, ], }, "collector_tag_show": { @@ -1017,7 +1017,7 @@ "collector_tag_create": { "msg": "Create a new tag with name specified by :opt:`--tag`.", "options": [ - OPT.tag, + OPT.tag_name, OPT.tag_data, ], }, diff --git a/opensvc/commands/svc/parser.py b/opensvc/commands/svc/parser.py index e8403e5e8..a841bb940 100644 --- a/opensvc/commands/svc/parser.py +++ b/opensvc/commands/svc/parser.py @@ -91,17 +91,17 @@ ":cmd:`push resinfo --sync` before a compliance run makes sure " "the pushed data has hit the collector database before the " "rulesets are contextualized."), - "tag": Option( - "--tag", default=None, - action="store", dest="tag", + "tag_name": Option( + "--name", default=None, + action="store", dest="name", help="The tag name, as shown by :cmd:`collector list tags`."), "tag_data": Option( - "--tag-data", default=None, - action="store", dest="tag_data", + "--data", default=None, + action="store", dest="data", help="The data stored with the tag. Typed tags, like :: expect a particular data structure."), "tag_attach_data": Option( - "--tag-attach-data", default=None, - action="store", dest="tag_attach_data", + "--attach-data", default=None, + action="store", dest="attach_data", help="The data stored with the tag attachment. Typed tags, like :: expect a particular data structure."), "to": Option( "--to", default=None, @@ -808,14 +808,14 @@ "collector_tag_attach": { "msg": "Set a node tag (pointed by --tag).", "options": [ - OPT.tag, + OPT.tag_name, OPT.tag_attach_data, ], }, "collector_tag_detach": { "msg": "Unset a node tag (pointed by --tag).", "options": [ - OPT.tag, + OPT.tag_name, ], }, "collector_tag_show": { @@ -833,7 +833,7 @@ "collector_tag_create": { "msg": "Create a new tag with name specified by :opt:`--tag`.", "options": [ - OPT.tag, + OPT.tag_name, OPT.tag_data, ], }, diff --git a/opensvc/core/collector/actions.py b/opensvc/core/collector/actions.py index f14fc1bb5..96429a1f0 100644 --- a/opensvc/core/collector/actions.py +++ b/opensvc/core/collector/actions.py @@ -217,7 +217,7 @@ def collector_show_actions(self): def collector_tag_detach(self): opts = {} - opts['tag_name'] = self.options.tag + opts['tag_name'] = self.options.name if self.path: opts['svcname'] = self.path d = self.collector.call('collector_untag', opts) @@ -230,8 +230,8 @@ def collector_tag_detach(self): def collector_tag_attach(self): opts = {} - opts['tag_name'] = self.options.tag - opts['tag_attach_data'] = self.options.tag_attach_data + opts['tag_name'] = self.options.name + opts['tag_attach_data'] = self.options.attach_data if self.path: opts['svcname'] = self.path d = self.collector.call('collector_tag', opts) @@ -244,12 +244,12 @@ def collector_tag_attach(self): def collector_tag_create(self): opts = {} - opts['tag_name'] = self.options.tag + opts['tag_name'] = self.options.name if opts['tag_name'] is None: print("missing parameter: --tag", file=sys.stderr) return 1 - opts['tag_data'] = self.options.tag_data - opts['tag_exclude'] = self.options.tag_exclude + opts['tag_data'] = self.options.data + opts['tag_exclude'] = self.options.exclude if self.path: opts['svcname'] = self.path d = self.collector.call('collector_create_tag', opts)