-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Sonic-config-engine]: View acls and ports or specifc port configs on sonic switch (Json) #3036
Conversation
retest this please |
retest this please |
retest vs please |
retest this please |
retest vs please |
@lguohan addressed your comments. Please have a look. |
@prprakas , I am not sure I understand your point, the show interface neighbor expected is broken due to this PR, i think. |
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.
please fix show interface neighbor expected
@lguohan Understood, fixed it under sonic-net/sonic-utilities#584. It seems to be good now, please have a look. |
…nder sonic-buildimage/pull/3036 (#584) - What I did Fixed show interface neigh expected which was broken because of sonic-net/sonic-buildimage#3036 - How I did it There was a change in the output format for --var-json option in sonic-config-engine,changes had to be done for show commands as well.
@prprakas, thanks for the PR. can you update the sonic-utilities submodule in the PR? |
@lguohan If I understand correctly, I think you are asking for the changes in sonic-utilities for the corresponding show commands. That change was already submitted under sonic-net/sonic-utilities#557 along with this PR and has already been approved. |
for this PR, you should include submodule update for that repo. |
can you resolve the conflict? |
9a14ebe
to
aeaf783
Compare
there are still conflict. |
8cb350b
to
32e1ee9
Compare
…n format) Using --var-json to display the acl and ports/specific port configs Editing the test(var_json_test) assertion due to change in output format of command Adding test for the interface argument added to Sonic config engine Test for the interface argument added
32e1ee9
to
f95233f
Compare
@lguohan I think there have been multiple other commits on src/sonic-utilities which are already included in sonic-buildimage https://github.com/Azure/sonic-buildimage/tree/master/src. I think updating src/sonic-utilities is not needed now. |
@lguohan any thing has changed I see the older tests are failing ? https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/buildimage-vs-image-pr/601/console. |
i think it is the unit test issue, the nightly build succeeded. |
retest this please |
yes, i think we can drop this pr, but can you fix sonic-utilities? |
…nder sonic-buildimage/pull/3036 (#584) - What I did Fixed show interface neigh expected which was broken because of sonic-net/sonic-buildimage#3036 - How I did it There was a change in the output format for --var-json option in sonic-config-engine,changes had to be done for show commands as well.
…atically (#17457) src/sonic-utilities * 1b1402f5 - (HEAD -> 202311, origin/202311) [hash]: Add ECMP/LAG hash algorithm CLI (#3036) (9 days ago) [Nazarii Hnydyn] * 71514ea3 - Revert "Run yang validation in unit test (#3025)" (#3055) (9 days ago) [Ying Xie] * b5daf5d4 - [dhcp_relay] Fix dhcp_relay counter display issue (#3054) (9 days ago) [Yaqiang Zhu] * b3172505 - [sflow][db_migrator] Egress Sflow support (#3020) (9 days ago) [Rajkumar-Marvell] * 1e813105 - [wol] Implement wol command line utility (#3048) (3 weeks ago) [Zhijian Li] * 8ebc56a0 - [sonic_installer]: Improve exception handling: introduce notes. (#3029) (3 weeks ago) [Nazarii Hnydyn] * 3610ce93 - [sonic-package-manager] Fix YANG validation failure on upgrade when feature has constraints in YANG model on FEATURE table (#2933) (3 weeks ago) [Stepan Blyshchak] * cfd2dd39 - Add container rsyslog.conf to the sys dump (#3039) (4 weeks ago) [Vivek] * c4b07828 - Support new platform in generic configuration update (#3038) (4 weeks ago) [Stephen Sun] * a8d236c8 - [fast-reboot-filter-routes.py] Remove click and improve error reporting (#3030) (4 weeks ago) [Stepan Blyshchak] * 75199c0f - [sonic-package-manager] insert newline in /etc/sonic/generated_services.conf (#3040) (4 weeks ago) [Stepan Blyshchak] * cd855698 - [VOQ][saidump] Modify generate_dump: replace save_saidump with save_saidump_by_route_size (#2972) (4 weeks ago) [JunhongMao] * f1e24ae5 - GCU support for Cisco-8000 features (#3010) (4 weeks ago) [rbpittman] * 67e1c3dc - Update GCU rsyslog validator (#3012) (4 weeks ago) [jingwenxie] * 253b7975 - [sonic-package-manager] do not modify config_db.json (#3032) (5 weeks ago) [Stepan Blyshchak] * 177dd8e8 - [sonic-package-manager] add generated service to /etc/sonic/generated_services.conf (#3037) (5 weeks ago) [Stepan Blyshchak] * 62fcd77a - Configure NTP according to extended configuration (#2835) (5 weeks ago) [Yevhen Fastiuk] * ced09404 - [dualtor_neighbor_check] Adjust zero-mac check condition (#3034) (5 weeks ago) [Longxiang Lyu] * a4eeb698 - [config] config reload should generate sysinfo if missing (#3031) (6 weeks ago) [jingwenxie] * e01fc891 - Run yang validation in unit test (#3025) (6 weeks ago) [ganglv]
…lly (#18935) #### Why I did it src/sonic-swss ``` * 198eb3d1 - (HEAD -> master, origin/master, origin/HEAD) Add transceiver info to bake only if supported (#3142) (2 hours ago) [Sudharsan Dhamal Gopalarathnam] * f62eed23 - [Mellanox] PFC watchdog long term solution to reduce false alarm (#3036) (35 hours ago) [Stephen Sun] ``` #### How I did it #### How to verify it #### Description for the changelog
…lly (#19432) #### Why I did it src/sonic-swss ``` * 8fd0837a - (HEAD -> 202311, origin/202311) Add support for ECMP and LAG hash offset (#3138) (4 hours ago) [Kumaresh Perumal] * 66b9dacf - [Mellanox] PFC watchdog long term solution to reduce false alarm (#3036) (4 hours ago) [Stephen Sun] * 14add20e - Revamp module build script to make it work for 5.15 on Ubuntu 20.04 (#3212) (7 hours ago) [Saikrishna Arcot] * 6a347ab4 - Add transceiver info to bake only if supported (#3142) (5 days ago) [Sudharsan Dhamal Gopalarathnam] ``` #### How I did it #### How to verify it #### Description for the changelog
Following features are added as the part of this PR, this only involves changes done to sonic-config-engine, I will submit a PR for changes done on sonic-utilities.
Signed-off-by: Prem Prakash [email protected]
- What I did
To view port configs and acl configs, added the support to sonic-config-engine and implemented the show commands for it
- How I did it
Modified sonic-cfggen file to add the support for acl and port running config. Even main.py file is modified under sonic-utilities/show folder.
- How to verify it
built sonic-utilities deb package and installed it and also changed the sonic-cfggen file in the switch under /usr/local/bin/sonic-cfggen
Added options interface and accesslist to the runningconfiguration option
admin@lnos-x1-a-csw02:~$ show runningconfiguration ?
Usage: show runningconfiguration [OPTIONS] COMMAND [ARGS]...
Show current running configuration information
Options:
-?, -h, --help Show this message and exit.
Commands:
accesslist Show acl running configuration
all Show full running configuration
bgp Show BGP running configuration
interface Show port running configuration
interfaces Show interfaces running configuration
ntp Show NTP running configuration
snmp Show SNMP information
admin@lnos-x1-a-csw02:~$
ACL config-
admin@lnos-x1-a-csw02:
$ show runningconfiguration accesslist${
"ACL_RULE": {
"NO-NSW-PACL-V4|DEFAULT_DENY": {
"PACKET_ACTION": "DROP",
"IP_TYPE": "IPv4ANY",
"PRIORITY": "0"
},
"NO-NSW-PACL-V4|Rule_20": {
"PACKET_ACTION": "FORWARD",
"DST_IP": "X.X.X.X/24",
"SRC_IP": "X.X.0.0/16",
"IP_TYPE": "IPv4ANY",
"PRIORITY": "999980"
}
}
}
admin@lnos-x1-a-csw02:
Port configs-
admin@lnos-x1-a-csw02:~$ show runningconfiguration interface
{
"PORT": {
"Ethernet0": {
"index": "1",
"lanes": "65,66,67,68",
"mtu": "9100",
"alias": "Eth1",
"admin_status": "up",
"speed": "100000"
},
"Ethernet4": {
"index": "2",
"lanes": "69,70,71,72",
"mtu": "9100",
"alias": "Eth2",
"admin_status": "up",
"speed": "100000"
},
"Ethernet8": {
"index": "3",
"lanes": "73,74,75,76",
"mtu": "9100",
"alias": "Eth3",
"admin_status": "up",
"speed": "100000"
},
"Ethernet12": {
"index": "4",
"lanes": "77,78,79,80",
"mtu": "9100",
"alias": "Eth4",
"admin_status": "up",
"speed": "100000"
}
}
Port config for a specific port-
admin@lnos-x1-a-csw02:
$ show runningconfiguration interface Ethernet0${
"Ethernet0": {
"admin_status": "up",
"alias": "Eth1",
"index": "1",
"lanes": "65,66,67,68",
"mtu": "9100",
"speed": "100000"
}
}
admin@lnos-x1-a-csw02: