Skip to content

Commit

Permalink
Fix command deletion for QoS interfaces module (#473)
Browse files Browse the repository at this point in the history
* Fix command deletion for QoS interfaces module

* Correct PR #
  • Loading branch information
stalabi1 authored Nov 6, 2024
1 parent 7b4b6f8 commit cd4757e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/473-qos-interfaces-deletion-bugfix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- sonic_qos_interfaces - Fix command deletion bug (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/473).
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def get_delete_qos_interfaces_requests(self, commands, have, is_delete_all):
if scheduler_policy and scheduler_policy == cfg_scheduler_policy:
url = '%s/interface=%s/output/scheduler-policy' % (QOS_INTF_PATH, name)
requests.append({'path': url, 'method': DELETE})

config_dict.update({'name': name, 'scheduler_policy': scheduler_policy})
if qos_maps and cfg_qos_maps:
maps_dict = {}
dscp_fwd_group = qos_maps.get('dscp_fwd_group')
Expand Down Expand Up @@ -426,7 +426,7 @@ def get_delete_qos_interfaces_requests(self, commands, have, is_delete_all):
requests.append(self.get_delete_map_request(name, 'pfc-priority-to-priority-group'))
maps_dict['pfc_priority_pg'] = pfc_priority_pg
if maps_dict:
config_dict['qos_maps'] = maps_dict
config_dict.update({'name': name, 'qos_maps': maps_dict})

if pfc and cfg_pfc:
pfc_dict = {}
Expand Down Expand Up @@ -479,7 +479,7 @@ def get_delete_qos_interfaces_requests(self, commands, have, is_delete_all):
if priorities_list:
pfc_dict['priorities'] = priorities_list
if pfc_dict:
config_dict['pfc'] = pfc_dict
config_dict.update({'name': name, 'pfc': pfc_dict})

if queues and cfg_queues:
queues_list = []
Expand All @@ -505,7 +505,7 @@ def get_delete_qos_interfaces_requests(self, commands, have, is_delete_all):
if queues_dict:
queues_list.append(queues_dict)
if queues_list:
config_dict['queues'] = queues_list
config_dict.update({'name': name, 'queues': queues_list})
if config_dict:
config_list.append(config_dict)
if not scheduler_policy and not qos_maps and not pfc and not queues:
Expand Down

0 comments on commit cd4757e

Please sign in to comment.