Fix QoS rule update
QoS rule (QosBandwidthLimitRule and QosMinimumBandwidthRule) update now expects to have direction field in the API request for checking for duplicates. This patch changes this by using the rule fetched from the policy and the update will work on that rule object instead of a newly created object which for minimum_bandwidth rule has no default direction, which causes the update to fail. Change-Id: Ib8f95bf14193a50f22102668bed9208a93d1caba Closes-Bug: #1815618
This commit is contained in:
parent
6920727fe1
commit
c1999a2b22
@ -438,8 +438,7 @@ class QoSPlugin(qos.QoSPluginBase):
|
||||
policy = policy_object.QosPolicy.get_policy_obj(context, policy_id)
|
||||
# Ensure the rule belongs to the policy.
|
||||
checker.check_bandwidth_rule_conflict(policy, rule_data)
|
||||
policy.get_rule_by_id(rule_id)
|
||||
rule = rule_cls(context, id=rule_id)
|
||||
rule = policy.get_rule_by_id(rule_id)
|
||||
rule.update_fields(rule_data, reset_changes=True)
|
||||
checker.check_rules_conflict(policy, rule)
|
||||
rule.update()
|
||||
|
Loading…
x
Reference in New Issue
Block a user