Merge "Enforce "qos_max_rate" and "qos_burst" in OVN QoS options"
This commit is contained in:
commit
82ebbbd556
|
@ -714,9 +714,9 @@ class OVNClient(object):
|
|||
qos_rule.update(match=match)
|
||||
# QoS of bandwidth_limit
|
||||
if 'qos_max_rate' in qos_options:
|
||||
qos_rule.update(rate=int(qos_options['qos_max_rate']),
|
||||
burst=int(qos_options['qos_burst']),
|
||||
dscp=None)
|
||||
burst = qos_options.get('qos_burst')
|
||||
qos_rule.update(rate=qos_options['qos_max_rate'],
|
||||
burst=burst, dscp=None)
|
||||
# QoS of dscp
|
||||
elif 'dscp_mark' in qos_options:
|
||||
qos_rule.update(rate=None, burst=None,
|
||||
|
|
|
@ -103,12 +103,10 @@ class OVNQosDriver(object):
|
|||
context, policy_id)
|
||||
for rule in all_rules:
|
||||
if isinstance(rule, qos_rule.QosBandwidthLimitRule):
|
||||
if rule.max_kbps:
|
||||
options['qos_max_rate'] = str(rule.max_kbps)
|
||||
options['qos_max_rate'] = rule.max_kbps
|
||||
if rule.max_burst_kbps:
|
||||
options['qos_burst'] = str(rule.max_burst_kbps)
|
||||
if rule.direction:
|
||||
options['direction'] = rule.direction
|
||||
options['qos_burst'] = rule.max_burst_kbps
|
||||
options['direction'] = rule.direction
|
||||
if isinstance(rule, qos_rule.QosDscpMarkingRule):
|
||||
options['dscp_mark'] = rule.dscp_mark
|
||||
options['direction'] = constants.EGRESS_DIRECTION
|
||||
|
|
|
@ -66,10 +66,11 @@ class TestOVNQosDriver(base.BaseTestCase):
|
|||
self.policy = self._create_fake_policy()
|
||||
self.port = self._create_fake_port()
|
||||
self.bw_rule = self._create_bw_limit_rule()
|
||||
self.bw_expected = {'direction': 'egress', 'qos_max_rate': '1000',
|
||||
'qos_burst': '100000'}
|
||||
self.bw_expected = {'qos_max_rate': 1000, 'qos_burst': 100000,
|
||||
'direction': constants.EGRESS_DIRECTION}
|
||||
self.dscp_rule = self._create_dscp_rule()
|
||||
self.dscp_expected = {'dscp_mark': 16, 'direction': 'egress'}
|
||||
self.dscp_expected = {'dscp_mark': 16,
|
||||
'direction': constants.EGRESS_DIRECTION}
|
||||
|
||||
def _create_bw_limit_rule(self):
|
||||
rule_obj = qos_rule.QosBandwidthLimitRule()
|
||||
|
|
Loading…
Reference in New Issue