From 9b6d02d5f958e5b2ea6155879fd0514a15ce2231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awek=20Kap=C5=82o=C5=84ski?= Date: Fri, 11 May 2018 13:04:23 +0200 Subject: Make max_burst_kbps option as optional for bw limit QoS rule Attribute max_burst_kbps of QoS bandwidth limit rule in Neutron's is optional in API so it should be also optional on client's side. Change-Id: Ie085b73fa885ff12f9ac080666cf3ca6a09b632a Related-Bug:#1770622 Task: 19658 Story: 2002017 --- openstackclient/network/v2/network_qos_rule.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'openstackclient/network') diff --git a/openstackclient/network/v2/network_qos_rule.py b/openstackclient/network/v2/network_qos_rule.py index f50e58b3..9c4275a8 100644 --- a/openstackclient/network/v2/network_qos_rule.py +++ b/openstackclient/network/v2/network_qos_rule.py @@ -29,11 +29,11 @@ RULE_TYPE_MINIMUM_BANDWIDTH = 'minimum-bandwidth' MANDATORY_PARAMETERS = { RULE_TYPE_MINIMUM_BANDWIDTH: {'min_kbps', 'direction'}, RULE_TYPE_DSCP_MARKING: {'dscp_mark'}, - RULE_TYPE_BANDWIDTH_LIMIT: {'max_kbps', 'max_burst_kbps'}} + RULE_TYPE_BANDWIDTH_LIMIT: {'max_kbps'}} OPTIONAL_PARAMETERS = { RULE_TYPE_MINIMUM_BANDWIDTH: set(), RULE_TYPE_DSCP_MARKING: set(), - RULE_TYPE_BANDWIDTH_LIMIT: {'direction'}} + RULE_TYPE_BANDWIDTH_LIMIT: {'direction', 'max_burst_kbps'}} DIRECTION_EGRESS = 'egress' DIRECTION_INGRESS = 'ingress' DSCP_VALID_MARKS = [0, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, @@ -62,11 +62,11 @@ def _check_type_parameters(attrs, type, is_create): notreq_params -= type_params if is_create and None in map(attrs.get, req_params): msg = (_('"Create" rule command for type "%(rule_type)s" requires ' - 'arguments %(args)s') % + 'arguments: %(args)s') % {'rule_type': type, 'args': ", ".join(sorted(req_params))}) raise exceptions.CommandError(msg) if set(attrs.keys()) & notreq_params: - msg = (_('Rule type "%(rule_type)s" only requires arguments %(args)s') + msg = (_('Rule type "%(rule_type)s" only requires arguments: %(args)s') % {'rule_type': type, 'args': ", ".join(sorted(type_params))}) raise exceptions.CommandError(msg) -- cgit v1.2.1