Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix optional params not applying to all interfaces (sonic-net#20313)
Currently optional params only get applied to the first child port in group. We want optional parameters to apply to all child ports in group. For example: "Ethernet0": { "default_brkout_mode": "2x400G", "autoneg": "on" }, In this scenario we want autoneg on to be in the config_db entry for both interfaces that belong to the group; Ethernet0 and Ethernet4. Currently this only gets applied to Ethernet0: (Pdb++) pp child_ports {'Ethernet0': {'alias': 'Ethernet1/1', 'autoneg': 'on', 'index': '1', 'lanes': '17,18,19,20', 'speed': '400000', 'subport': '1'}, 'Ethernet4': {'alias': 'Ethernet1/5', 'index': '1', 'lanes': '21,22,23,24', 'speed': '400000', 'subport': '2'}} With this change it now gets applied to all interfaces in the group as expected (Pdb) pp child_ports {'Ethernet0': {'alias': 'Ethernet1/1', 'autoneg': 'on', 'index': '1', 'lanes': '17,18,19,20', 'speed': '400000', 'subport': '1'}, 'Ethernet4': {'alias': 'Ethernet1/5', 'autoneg': 'on', 'index': '1', 'lanes': '21,22,23,24', 'speed': '400000', 'subport': '2'}} Why I did it I need to apply optional hwsku params for a group of interfaces. How I did it Just changed to iterate over every child port in group. How to verify it Introduction to the problem shows verification of the solution. Check the output manually and also fixed the unit test to correspond and pass.
- Loading branch information