Skip to content

Commit c58f027

Browse files
committed
network: Make 'network qos rule create --type' option required
When we create a network qos rule we need specify the type so that we can call the corresponding API. It's not possible to use the command without the type so mark it as required. This was already being done but inline. Change-Id: I559f884bac198d2c69e800620aef66b200473418 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
1 parent 86bca18 commit c58f027

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

openstackclient/network/v2/network_qos_rule.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ def _get_attrs(network_client, parsed_args, is_create=False):
8484
{'rule_id': parsed_args.id})
8585
raise exceptions.CommandError(msg)
8686
else:
87-
if not parsed_args.type:
88-
msg = _('"Create" rule command requires argument "type"')
89-
raise exceptions.CommandError(msg)
9087
rule_type = parsed_args.type
9188
if parsed_args.max_kbps is not None:
9289
attrs['max_kbps'] = parsed_args.max_kbps
@@ -188,6 +185,7 @@ def get_parser(self, prog_name):
188185
parser.add_argument(
189186
'--type',
190187
metavar='<type>',
188+
required=True,
191189
choices=[RULE_TYPE_MINIMUM_BANDWIDTH,
192190
RULE_TYPE_DSCP_MARKING,
193191
RULE_TYPE_BANDWIDTH_LIMIT],

0 commit comments

Comments
 (0)