Skip to content

Commit 9e49047

Browse files
committed
Improve help strings for tap services
This is a follow up patch to feedback from[1] [1] https://review.opendev.org/c/openstack/python-openstackclient/+/963445/comment/8f9576d4_938391ea/ Change-Id: I1c1ee68b37ef4c87c13d18e773c19b4ca5814ead Signed-off-by: Miro Tomaska <mtomaska@redhat.com>
1 parent 97c2238 commit 9e49047

File tree

3 files changed

+40
-39
lines changed

3 files changed

+40
-39
lines changed

openstackclient/network/v2/taas/tap_flow.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@
4747

4848

4949
def _add_updatable_args(parser):
50-
parser.add_argument('--name', help=_('Name of this Tap service.'))
50+
parser.add_argument('--name', help=_('Name of the tap flow.'))
5151
parser.add_argument(
52-
'--description', help=_('Description for this Tap service.')
52+
'--description', help=_('Description of the tap flow.')
5353
)
5454

5555

5656
class CreateTapFlow(command.ShowOne):
57-
_description = _("Create a tap flow")
57+
_description = _("Create a new tap flow.")
5858

5959
def get_parser(self, prog_name):
6060
parser = super().get_parser(prog_name)
@@ -64,13 +64,15 @@ def get_parser(self, prog_name):
6464
'--port',
6565
required=True,
6666
metavar="SOURCE_PORT",
67-
help=_('Source port to which the Tap Flow is connected.'),
67+
help=_('Source port (name or ID) to monitor.'),
6868
)
6969
parser.add_argument(
7070
'--tap-service',
7171
required=True,
7272
metavar="TAP_SERVICE",
73-
help=_('Tap Service to which the Tap Flow belongs.'),
73+
help=_(
74+
'Tap service (name or ID) to associate with this tap flow.'
75+
),
7476
)
7577
parser.add_argument(
7678
'--direction',
@@ -79,15 +81,15 @@ def get_parser(self, prog_name):
7981
choices=['IN', 'OUT', 'BOTH'],
8082
type=lambda s: s.upper(),
8183
help=_(
82-
'Direction of the Tap flow. Possible options are: '
83-
'IN, OUT, BOTH'
84+
'Direction of the Tap flow. Valid options are: '
85+
'IN, OUT and BOTH'
8486
),
8587
)
8688
parser.add_argument(
8789
'--vlan-filter',
8890
required=False,
8991
metavar="VLAN_FILTER",
90-
help=_('VLAN Ids to be mirrored in the form of range string.'),
92+
help=_('VLAN IDs to mirror in the form of range string.'),
9193
)
9294
return parser
9395

@@ -125,7 +127,7 @@ def take_action(self, parsed_args):
125127

126128

127129
class ListTapFlow(command.Lister):
128-
_description = _("List tap flows that belong to a given tenant")
130+
_description = _("List tap flows.")
129131

130132
def get_parser(self, prog_name):
131133
parser = super().get_parser(prog_name)
@@ -158,14 +160,14 @@ def take_action(self, parsed_args):
158160

159161

160162
class ShowTapFlow(command.ShowOne):
161-
_description = _("Show information of a given tap flow")
163+
_description = _("Show tap flow details.")
162164

163165
def get_parser(self, prog_name):
164166
parser = super().get_parser(prog_name)
165167
parser.add_argument(
166168
TAP_FLOW,
167169
metavar=f"<{TAP_FLOW}>",
168-
help=_("ID or name of tap flow to look up."),
170+
help=_("Tap flow to display (name or ID)."),
169171
)
170172
return parser
171173

@@ -181,15 +183,15 @@ def take_action(self, parsed_args):
181183

182184

183185
class DeleteTapFlow(command.Command):
184-
_description = _("Delete a tap flow")
186+
_description = _("Delete a tap flow.")
185187

186188
def get_parser(self, prog_name):
187189
parser = super().get_parser(prog_name)
188190
parser.add_argument(
189191
TAP_FLOW,
190192
metavar=f"<{TAP_FLOW}>",
191193
nargs="+",
192-
help=_("ID(s) or name(s) of tap flow to delete."),
194+
help=_("Tap flow to delete (name or ID)."),
193195
)
194196
return parser
195197

@@ -200,7 +202,6 @@ def take_action(self, parsed_args):
200202
try:
201203
id = client.find_tap_flow(id_or_name, ignore_missing=False).id
202204
client.delete_tap_flow(id)
203-
LOG.warning("Tap flow %(id)s deleted", {'id': id})
204205
except Exception as e:
205206
fails += 1
206207
LOG.error(
@@ -224,7 +225,7 @@ def get_parser(self, prog_name):
224225
parser.add_argument(
225226
TAP_FLOW,
226227
metavar=f"<{TAP_FLOW}>",
227-
help=_("ID or name of tap flow to update."),
228+
help=_("Tap flow to modify (name or ID)."),
228229
)
229230
_add_updatable_args(parser)
230231
return parser

openstackclient/network/v2/taas/tap_mirror.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def _get_columns(item):
4949

5050

5151
class CreateTapMirror(command.ShowOne):
52-
_description = _("Create a Tap Mirror")
52+
_description = _("Create a new tap mirror.")
5353

5454
def get_parser(self, prog_name):
5555
parser = super().get_parser(prog_name)
@@ -60,32 +60,32 @@ def get_parser(self, prog_name):
6060
dest='port_id',
6161
required=True,
6262
metavar="PORT",
63-
help=_('Port to which the Tap Mirror is connected.'),
63+
help=_('Port (name or ID) to which the Tap Mirror is connected.'),
6464
)
6565
parser.add_argument(
6666
'--directions',
6767
dest='directions',
6868
action=osc_port.JSONKeyValueAction,
6969
required=True,
7070
help=_(
71-
'A dictionary of direction and tunnel_id. Direction can '
72-
'be IN and OUT.'
71+
'Dictionary of direction and tunnel_id. Valid directions are: '
72+
'IN and OUT.'
7373
),
7474
)
7575
parser.add_argument(
7676
'--remote-ip',
7777
dest='remote_ip',
7878
required=True,
7979
help=_(
80-
'The remote IP of the Tap Mirror, this will be the '
81-
'remote end of the GRE or ERSPAN v1 tunnel'
80+
'Remote IP address for the tap mirror (remote end of the '
81+
'GRE or ERSPAN v1 tunnel).'
8282
),
8383
)
8484
parser.add_argument(
8585
'--mirror-type',
8686
dest='mirror_type',
8787
required=True,
88-
help=_('The type of the mirroring, it can be gre or erspanv1'),
88+
help=_('Mirror type. Valid values are: gre and erspanv1.'),
8989
)
9090
return parser
9191

@@ -120,7 +120,7 @@ def take_action(self, parsed_args):
120120

121121

122122
class ListTapMirror(command.Lister):
123-
_description = _("List Tap Mirrors that belong to a given tenant")
123+
_description = _("List tap mirrors.")
124124

125125
def get_parser(self, prog_name):
126126
parser = super().get_parser(prog_name)
@@ -148,14 +148,14 @@ def take_action(self, parsed_args):
148148

149149

150150
class ShowTapMirror(command.ShowOne):
151-
_description = _("Show information of a given Tap Mirror")
151+
_description = _("Show tap mirror details.")
152152

153153
def get_parser(self, prog_name):
154154
parser = super().get_parser(prog_name)
155155
parser.add_argument(
156156
TAP_MIRROR,
157157
metavar=f"<{TAP_MIRROR}>",
158-
help=_("ID or name of Tap Mirror to look up."),
158+
help=_("Tap mirror to display (name or ID)."),
159159
)
160160
return parser
161161

@@ -171,15 +171,15 @@ def take_action(self, parsed_args):
171171

172172

173173
class DeleteTapMirror(command.Command):
174-
_description = _("Delete a Tap Mirror")
174+
_description = _("Delete a tap mirror.")
175175

176176
def get_parser(self, prog_name):
177177
parser = super().get_parser(prog_name)
178178
parser.add_argument(
179179
TAP_MIRROR,
180180
metavar=f"<{TAP_MIRROR}>",
181181
nargs="+",
182-
help=_("ID(s) or name(s) of the Tap Mirror to delete."),
182+
help=_("Tap mirror to delete (name or ID)."),
183183
)
184184
return parser
185185

@@ -210,14 +210,14 @@ def take_action(self, parsed_args):
210210

211211

212212
class UpdateTapMirror(command.ShowOne):
213-
_description = _("Update a Tap Mirror.")
213+
_description = _("Update a tap mirror.")
214214

215215
def get_parser(self, prog_name):
216216
parser = super().get_parser(prog_name)
217217
parser.add_argument(
218218
TAP_MIRROR,
219219
metavar=f"<{TAP_MIRROR}>",
220-
help=_("ID or name of the Tap Mirror to update."),
220+
help=_("Tap mirror to modify (name or ID)."),
221221
)
222222
tap_service._add_updatable_args(parser)
223223
return parser

openstackclient/network/v2/taas/tap_service.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939

4040

4141
def _add_updatable_args(parser):
42-
parser.add_argument('--name', help=_('Name of this Tap service.'))
42+
parser.add_argument('--name', help=_('Name of the tap service.'))
4343
parser.add_argument(
44-
'--description', help=_('Description for this Tap service.')
44+
'--description', help=_('Description of the tap service.')
4545
)
4646

4747

@@ -54,7 +54,7 @@ def _get_columns(item):
5454

5555

5656
class CreateTapService(command.ShowOne):
57-
_description = _("Create a tap service")
57+
_description = _("Create a new tap service.")
5858

5959
def get_parser(self, prog_name):
6060
parser = super().get_parser(prog_name)
@@ -65,7 +65,7 @@ def get_parser(self, prog_name):
6565
dest='port_id',
6666
required=True,
6767
metavar="PORT",
68-
help=_('Port to which the Tap service is connected.'),
68+
help=_('Port (name or ID) to connect to the tap service.'),
6969
)
7070
return parser
7171

@@ -94,7 +94,7 @@ def take_action(self, parsed_args):
9494

9595

9696
class ListTapService(command.Lister):
97-
_description = _("List tap services that belong to a given project")
97+
_description = _("List tap services.")
9898

9999
def get_parser(self, prog_name):
100100
parser = super().get_parser(prog_name)
@@ -122,14 +122,14 @@ def take_action(self, parsed_args):
122122

123123

124124
class ShowTapService(command.ShowOne):
125-
_description = _("Show information of a given tap service")
125+
_description = _("Show tap service details.")
126126

127127
def get_parser(self, prog_name):
128128
parser = super().get_parser(prog_name)
129129
parser.add_argument(
130130
TAP_SERVICE,
131131
metavar=f"<{TAP_SERVICE}>",
132-
help=_("ID or name of tap service to look up."),
132+
help=_("Tap service to display (name or ID)."),
133133
)
134134
return parser
135135

@@ -145,15 +145,15 @@ def take_action(self, parsed_args):
145145

146146

147147
class DeleteTapService(command.Command):
148-
_description = _("Delete a tap service")
148+
_description = _("Delete a tap service.")
149149

150150
def get_parser(self, prog_name):
151151
parser = super().get_parser(prog_name)
152152
parser.add_argument(
153153
TAP_SERVICE,
154154
metavar=f"<{TAP_SERVICE}>",
155155
nargs="+",
156-
help=_("ID(s) or name(s) of tap service to delete."),
156+
help=_("Tap service to delete (name or ID)."),
157157
)
158158
return parser
159159

@@ -191,7 +191,7 @@ def get_parser(self, prog_name):
191191
parser.add_argument(
192192
TAP_SERVICE,
193193
metavar=f"<{TAP_SERVICE}>",
194-
help=_("ID or name of tap service to update."),
194+
help=_("Tap service to modify (name or ID)."),
195195
)
196196
_add_updatable_args(parser)
197197
return parser

0 commit comments

Comments
 (0)