enhance Klish parser with improved usability and python3 support#76
Merged
renukamanavalan merged 4 commits intosonic-net:masterfrom Jan 4, 2021
Merged
Conversation
3 tasks
Closed
renukamanavalan
pushed a commit
to sonic-net/sonic-buildimage
that referenced
this pull request
Jun 3, 2021
…c-cli cmd (#6148) - Why I did it migrate to python3 support add dependent packages for Klish allow login as non-root user - How I did it update sonic-cli script to start Klish with user name, system name and timeout update the Dockerfile.j2 to resolve dependent packages add python3-dev for Klish use - How to verify it Incremental buster build with sonic-net/sonic-mgmt-framework#76 and verify the sonic-cli - Description for the changelog Migrate to python3.7 support, update sonic-cli script and resolve package dependencies
carl-nokia
pushed a commit
to carl-nokia/sonic-buildimage
that referenced
this pull request
Aug 7, 2021
…c-cli cmd (sonic-net#6148) - Why I did it migrate to python3 support add dependent packages for Klish allow login as non-root user - How I did it update sonic-cli script to start Klish with user name, system name and timeout update the Dockerfile.j2 to resolve dependent packages add python3-dev for Klish use - How to verify it Incremental buster build with sonic-net/sonic-mgmt-framework#76 and verify the sonic-cli - Description for the changelog Migrate to python3.7 support, update sonic-cli script and resolve package dependencies
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.
Klish enhancements for sonic-mgmt-framework to improve usability and python3.7 support in Buster
CLI built-in functions "clish_pyobj" and "clish_restcl" can be use to reduce time taken to execute a command by eliminating the sub-shell interpreter overhead.
The “clish_restcl” method uses libcurl to make REST client call from actioner. The GET operation is not supported as we currently don't handle rendering using jinja templates.
e.g.
oper=PATCH url=/restconf/data/openconfig-interfaces:interfaces/interface=Vlan${vlan-id}/config body={"openconfig-interfaces:config": {"name": "Vlan${vlan-id}"}}The “clish_pyobj” uses embedding Python to execute the Python scripts to make REST client call via Request package.
e.g.
sonic_cli_if patch_openconfig_interfaces_interfaces_interface_config Vlan${vlan-id}Similar to the pattern attribute with select method in Opensource Klish, the ext_pattern with regexp_select can be used for auto completion.
e.g.
An interface name can be specified as “interface Ethernet 1” or “interface Eth1”.
Another usacase is that, if multiple options in the same PTYPE are defined to support all possible interface options, the ext_help can be used along with ext_help attributes to provide multiple help string for corresponding options.
e.g.