Sorting the information generated by sonic-cfggen for all j2 templates.#1616
Merged
lguohan merged 1 commit intosonic-net:masterfrom Apr 19, 2018
Merged
Sorting the information generated by sonic-cfggen for all j2 templates.#1616lguohan merged 1 commit intosonic-net:masterfrom
lguohan merged 1 commit intosonic-net:masterfrom
Conversation
With this patch all the content of the files generated by "sonic-cfggen -d -t" instructions will now be sorted, which is very useful for operational and troubleshooting purposes. See below a few examples of this behavior. Also, a few sonic-cfggen UT's have been modified to accomodate the new sorted configurations.
admin@lnos-x1-a-asw02:~$ sonic-cfggen -d -t /usr/share/sonic/templates/interfaces.j2 | more
…
auto lo
iface lo inet loopback
iface lo inet static
address 10.10.1.2
netmask 255.255.255.255
auto eth0
iface eth0 inet dhcp
allow-hotplug Ethernet112
iface Ethernet112 inet static
mtu 9100
address 10.1.2.2
netmask 255.255.255.0
allow-hotplug Ethernet112
iface Ethernet112 inet6 static
mtu 9100
address fc00:1:2::2
netmask 64
allow-hotplug Ethernet116
iface Ethernet116 inet static
mtu 9100
address 10.2.2.2
netmask 255.255.255.0
allow-hotplug Ethernet116
iface Ethernet116 inet6 static
mtu 9100
address fc00:2:2::2
netmask 64
allow-hotplug Ethernet120
iface Ethernet120 inet static
mtu 9100
address 10.3.2.2
netmask 255.255.255.0
root@lnos-x1-a-csw01:/# sonic-cfggen -d -y /etc/sonic/deployment_id_asn_map.yml -t /usr/share/sonic/templates/bgpd.conf.j2
…
router bgp 65100
…
network 10.10.2.1/32
neighbor 10.0.0.1 remote-as 65200
neighbor 10.0.0.1 description ARISTA01T2
address-family ipv4
neighbor 10.0.0.1 activate
maximum-paths 64
exit-address-family
neighbor 10.0.0.11 remote-as 65200
neighbor 10.0.0.11 description ARISTA06T2
address-family ipv4
neighbor 10.0.0.11 activate
maximum-paths 64
exit-address-family
neighbor 10.0.0.13 remote-as 65200
neighbor 10.0.0.13 description ARISTA07T2
address-family ipv4
neighbor 10.0.0.13 activate
maximum-paths 64
exit-address-family
neighbor 10.0.0.15 remote-as 65200
neighbor 10.0.0.15 description ARISTA08T2
address-family ipv4
neighbor 10.0.0.15 activate
maximum-paths 64
exit-address-family
root@lnos-x1-a-asw02:/# sonic-cfggen -d -t /usr/share/sonic/templates/lldpd.conf.j2
…
configure ports Ethernet4 lldp portidsubtype local Eth2/1 description ixia-card2-port8:Eth1/2/8
configure ports Ethernet112 lldp portidsubtype local Eth29/1 description lnos-x1-a-csw01:Eth29/1
configure ports Ethernet116 lldp portidsubtype local Eth30/1 description lnos-x1-a-csw02:Eth30/1
configure ports Ethernet120 lldp portidsubtype local Eth31/1 description lnos-x1-a-csw03:Eth31/1
configure ports Ethernet124 lldp portidsubtype local Eth32/1 description lnos-x1-a-csw04:Eth32/1
root@lnos-x1-a-asw02:/# sonic-cfggen -d -t /usr/share/sonic/templates/ports.json.j2 | more
[
{
"PORT_TABLE:Ethernet0": {
"speed": "10000",
"description": ""
},
"OP": "SET"
},
{
"PORT_TABLE:Ethernet1": {
"speed": "10000",
"description": ""
},
"OP": "SET"
},
{
"PORT_TABLE:Ethernet2": {
"speed": "10000",
"description": ""
},
"OP": "SET"
},
]
lguohan
approved these changes
Apr 18, 2018
jleveque
approved these changes
Apr 18, 2018
mssonicbld
added a commit
that referenced
this pull request
Jun 21, 2025
…tically (#23049) #### Why I did it src/sonic-sairedis ``` * c7c2692a - (HEAD -> 202505, origin/202505) [TAM]: Add default SAI_TAM_ATTR_TELEMETRY_OBJECTS_LIST of TAM for saivs create operation (#1616) (18 hours ago) [mssonicbld] ``` #### How I did it #### How to verify it #### Description for the changelog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With this patch all the content of the files generated by "sonic-cfggen -d -t" instructions will now be sorted, which is very useful for operational and troubleshooting purposes. See below a few examples of this behavior. Also, a few sonic-cfggen UT's have been modified to accommodate the new sorted configurations, and thereby, allowing the building process to successfully complete.