-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Support L1 & L3 Config generation in SONiC #7637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6ed124f
d9e98f0
37e8dc2
7e80cbe
30c591c
d27bbde
975daf5
8932089
8bb7f1f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| { | ||
| "DEVICE_METADATA": { | ||
| "localhost" : { | ||
| "hwsku" : "{{ DEVICE_METADATA.localhost.hwsku }}" | ||
| } | ||
| }, | ||
| {% set ns = {'firstPrinted': False} -%} | ||
| "PORT": { | ||
| {%- for key, value in PORT.items() -%} | ||
| {%- if ns.firstPrinted %},{% endif %} | ||
|
|
||
| "{{ key }}": { | ||
| {%- for keyPort, valuePort in value.items() %} | ||
|
|
||
| {% if keyPort != "admin_status" %}"{{ keyPort }}": "{{ valuePort }}",{% endif %} | ||
| {%- endfor %} | ||
|
|
||
| "admin_status": "{{ value.admin_status|default("up") }}", | ||
| "mtu": "9100" | ||
| } | ||
| {%- if ns.update({'firstPrinted': True}) %}{% endif -%} | ||
| {%- endfor %} | ||
|
|
||
| } | ||
| } | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| { | ||
| "DEVICE_METADATA": { | ||
| "localhost" : { | ||
| "hwsku" : "{{ DEVICE_METADATA.localhost.hwsku }}" | ||
| } | ||
| }, | ||
| {% set ns = {'firstPrinted': False} -%} | ||
| "PORT": { | ||
| {%- for key, value in PORT.items() -%} | ||
| {%- if ns.firstPrinted %},{% endif %} | ||
|
|
||
| "{{ key }}": { | ||
| {%- for keyPort, valuePort in value.items() %} | ||
|
|
||
| {% if keyPort != "admin_status" %}"{{ keyPort }}": "{{ valuePort }}",{% endif %} | ||
| {%- endfor %} | ||
|
|
||
| "admin_status": "{{ value.admin_status|default("up") }}", | ||
| "mtu": "9100" | ||
| } | ||
| {%- if ns.update({'firstPrinted': True}) %}{% endif -%} | ||
| {%- endfor %} | ||
|
|
||
| }, | ||
| "LOOPBACK_INTERFACE": { | ||
| "Loopback0": {}, | ||
| "Loopback0|10.1.0.1/32": {} | ||
| }, | ||
| "BGP_NEIGHBOR": {}, | ||
| "DEVICE_NEIGHBOR": {}, | ||
| "INTERFACE": { | ||
| "Ethernet0": {}, | ||
| "Ethernet1": {}, | ||
| "Ethernet2": {}, | ||
| "Ethernet3": {}, | ||
| "Ethernet4": {}, | ||
| "Ethernet5": {}, | ||
| "Ethernet6": {}, | ||
| "Ethernet7": {}, | ||
| "Ethernet8": {}, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is an l3 template did you want to add IP addresses to these interfaces in your usecase?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sure, removed.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In the review mtg, there was an ask from Guhon and team to not hardcode the ip address etc. Even though the config_samples.py has other areas like generate_t1_sample_config catered to specific needs, this method is made more generic as per request. |
||
| "Ethernet9": {}, | ||
| "Ethernet10": {}, | ||
| "Ethernet11": {}, | ||
| "Ethernet12": {}, | ||
| "Ethernet13": {}, | ||
| "Ethernet14": {}, | ||
| "Ethernet15": {}, | ||
| "Ethernet16": {}, | ||
| "Ethernet17": {}, | ||
| "Ethernet18": {}, | ||
| "Ethernet19": {}, | ||
| "Ethernet20": {}, | ||
| "Ethernet21": {}, | ||
| "Ethernet22": {}, | ||
| "Ethernet23": {}, | ||
| "Ethernet24": {}, | ||
| "Ethernet25": {}, | ||
| "Ethernet26": {}, | ||
| "Ethernet27": {}, | ||
| "Ethernet28": {}, | ||
| "Ethernet29": {}, | ||
| "Ethernet30": {}, | ||
| "Ethernet31": {} | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # name lanes alias index speed | ||
| Ethernet0 1296,1297,1298,1299 Ethernet0 0 100000 | ||
| Ethernet1 1300,1301,1302,1303 Ethernet1 1 100000 | ||
| Ethernet2 1288,1289,1290,1291 Ethernet2 2 100000 | ||
| Ethernet3 1292,1293,1294,1295 Ethernet3 3 100000 | ||
| Ethernet4 1280,1281,1282,1283 Ethernet4 4 100000 | ||
| Ethernet5 1284,1285,1286,1287 Ethernet5 5 100000 | ||
| Ethernet6 1032,1033,1034,1035 Ethernet6 6 100000 | ||
| Ethernet7 1036,1037,1038,1039 Ethernet7 7 100000 | ||
| Ethernet8 1024,1025,1026,1027 Ethernet8 8 100000 | ||
| Ethernet9 1028,1029,1030,1031 Ethernet9 9 100000 | ||
| Ethernet10 772,773,774,775 Ethernet10 10 100000 | ||
| Ethernet11 768,769,770,771 Ethernet11 11 100000 | ||
| Ethernet12 780,781,782,783 Ethernet12 12 100000 | ||
| Ethernet13 776,777,778,779 Ethernet13 13 100000 | ||
| Ethernet14 528,529,530,531 Ethernet14 14 100000 | ||
| Ethernet15 532,533,534,535 Ethernet15 15 100000 | ||
| Ethernet16 520,521,522,523 Ethernet16 16 100000 | ||
| Ethernet17 524,525,526,527 Ethernet17 17 100000 | ||
| Ethernet18 512,513,514,515 Ethernet18 18 100000 | ||
| Ethernet19 516,517,518,519 Ethernet19 19 100000 | ||
| Ethernet20 272,273,274,275 Ethernet20 20 100000 | ||
| Ethernet21 276,277,278,279 Ethernet21 21 100000 | ||
| Ethernet22 264,265,266,267 Ethernet22 22 100000 | ||
| Ethernet23 268,269,270,271 Ethernet23 23 100000 | ||
| Ethernet24 256,257,258,259 Ethernet24 24 100000 | ||
| Ethernet25 260,261,262,263 Ethernet25 25 100000 | ||
| Ethernet26 16,17,18,19 Ethernet26 26 100000 | ||
| Ethernet27 20,21,22,23 Ethernet27 27 100000 | ||
| Ethernet28 8,9,10,11 Ethernet28 28 100000 | ||
| Ethernet29 12,13,14,15 Ethernet29 29 100000 | ||
| Ethernet30 0,1,2,3 Ethernet30 30 100000 | ||
| Ethernet31 4,5,6,7 Ethernet31 31 100000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a unit test for this? You can refer as done for #7215
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comments. Added UT. Please review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prsunny do you have any more comments or else would be able to approve this PR ?