summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2021-03-19 18:36:44 +0000
committerStephen Finucane <sfinucan@redhat.com>2021-03-19 18:39:08 +0000
commitc58f0277a74a0f94638689de7db297f48243048e (patch)
tree389104d5e55aedcabe07fcddeb9e31d4e9bdb4bd /openstackclient
parent86bca18b74539d024e3854af0dfd3552c4d3b50b (diff)
downloadpython-openstackclient-c58f0277a74a0f94638689de7db297f48243048e.tar.gz
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>
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/network/v2/network_qos_rule.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/openstackclient/network/v2/network_qos_rule.py b/openstackclient/network/v2/network_qos_rule.py
index 28c5600a..2e4b385d 100644
--- a/openstackclient/network/v2/network_qos_rule.py
+++ b/openstackclient/network/v2/network_qos_rule.py
@@ -84,9 +84,6 @@ def _get_attrs(network_client, parsed_args, is_create=False):
{'rule_id': parsed_args.id})
raise exceptions.CommandError(msg)
else:
- if not parsed_args.type:
- msg = _('"Create" rule command requires argument "type"')
- raise exceptions.CommandError(msg)
rule_type = parsed_args.type
if parsed_args.max_kbps is not None:
attrs['max_kbps'] = parsed_args.max_kbps
@@ -188,6 +185,7 @@ class CreateNetworkQosRule(command.ShowOne):
parser.add_argument(
'--type',
metavar='<type>',
+ required=True,
choices=[RULE_TYPE_MINIMUM_BANDWIDTH,
RULE_TYPE_DSCP_MARKING,
RULE_TYPE_BANDWIDTH_LIMIT],