Skip to content

Commit

Permalink
Rename the collector tag commandset options
Browse files Browse the repository at this point in the history
--tag => --name
--tag-data => --data
--tag-attach-data => --attach-data
  • Loading branch information
cvaroqui committed Jun 9, 2023
1 parent 78c3bc2 commit b1e0d8a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
20 changes: 10 additions & 10 deletions opensvc/commands/node/parser.py
Expand Up @@ -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 <name>::<type> 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 <name>::<type> expect a particular data structure."),
"target": Option(
"--target", default=None, action="store", dest="target",
Expand Down Expand Up @@ -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": {
Expand All @@ -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,
],
},
Expand Down
20 changes: 10 additions & 10 deletions opensvc/commands/svc/parser.py
Expand Up @@ -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 <name>::<type> 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 <name>::<type> expect a particular data structure."),
"to": Option(
"--to", default=None,
Expand Down Expand Up @@ -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": {
Expand All @@ -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,
],
},
Expand Down
12 changes: 6 additions & 6 deletions opensvc/core/collector/actions.py
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit b1e0d8a

Please sign in to comment.