-
Notifications
You must be signed in to change notification settings - Fork 664
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
[201911]SKU Creator Tool #1245
[201911]SKU Creator Tool #1245
Conversation
This pull request introduces 1 alert when merging 99565ed into c0df635 - view on LGTM.com new alerts:
|
retest this please |
scripts/sonic_sku_create.py
Outdated
@@ -0,0 +1,776 @@ | |||
#!/usr/bin/env python3 |
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.
This script should be Python 2 compatible and the shebang should read #!/usr/bin/env python2
for 201911 branch.
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.
addressed in next commit.
This pull request introduces 1 alert when merging a4fc991 into c0df635 - view on LGTM.com new alerts:
|
It appears you copied over the code from the master branch after I converted it to Python 3, which explains the shebang and the LGTM alerts. This code needs to be Python 2-compatible in the 201911 branch. |
Closing this PR because I have created a similar PR with cherry pick from Master branch. |
Revert "Refine getDbId() calling to fix build after swss-common change (sonic-net#1245)" This shoudl fix VS build. Signed-off-by: Abhishek Dosi <[email protected]>
[sonic-swsss] Fix the issue of field "next_hop_ip" not getting updated in state DB in ERSPAN Mirror (sonic-net#1375) [vlanmgr] Support Jumbo Frame By Default (sonic-net#1393) [fec] added logic that put port down before applying fec onfiguration (sonic-net#1399) [fec] Get FEC mode when port is already admin down (sonic-net#1403) Refine getDbId() calling to fix build after swss-common change (sonic-net#1245)
- What I did
I added a new script file sonic_sku_create.py to generate a new HWSKU based on XML file or Minigraph. But, focus is on creating HWSKU based on XML file and not on the minigraph and l2 mode. I also added a unit test pyTest script sku_create_test.py in sonic-utilities-test folder to test the script in Unit Testing mode.
Motivation: To create SKU for Mellanox platforms based on XML file with Port related inputs and also through Minigraph file.
This tool also allows to split a port or unsplit ports based on configuration which modifies the port related information in port_config.ini and config_db.json
usage: sonic_sku_create.py [-h] [-v]
(-f FILE | -m [MINIGRAPH_FILE] | -j JSON_FILE | -pp PORT_SPLIT PORT_SPLIT)
[-b BASE] [-r] [-k HWSKU] [-p] [-vv]
Create a new SKU
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-f FILE, --file FILE SKU definition from xml file. -f OR -m or -j must be provided when creating a new SKU
-m [MINIGRAPH_FILE], --minigraph_file [MINIGRAPH_FILE]
SKU definition from minigraph file. -f OR -m or -j must be provided when creating a new SKU
-j JSON_FILE, --json_file JSON_FILE
SKU definition from config_db.json file. -f OR -m OR -j must be provided when creating a new SKU
-pp PORT_SPLIT PORT_SPLIT, --port_split PORT_SPLIT PORT_SPLIT
port name and split
-b BASE, --base BASE SKU base definition
-r, --remove Remove SKU folder
-k HWSKU, --hwsku HWSKU
SKU name to be used when creating a new SKU or for L2 configuration mode
-p, --print Print port_config.ini without creating a new SKU
-vv, --verbose Verbose output
Output:
Creation of Port_config.ini file.
Modifying Port_config.ini and config_db.json based on port split and unsplit configuration.
- How I did it
I did it by adding these files which are required for new SKU generation in the forthcoming releases.
- How to verify it
I verified all the options of sonic_sku_create.py file and tested them thoroughly as well as created a test case in sku_create_test.py file to test the functionality of sonic_sku_create.py in Unit Test mode.
- Previous command output (if the output of a command-line utility has changed)
None
- New command output (if the output of a command-line utility has changed)