-
Notifications
You must be signed in to change notification settings - Fork 650
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
Add Remote CLI on Chassis to simplify connections between supervisor and linecard #2302
Draft
noahsolomon-ms
wants to merge
22
commits into
sonic-net:master
Choose a base branch
from
noahsolomon-ms:remote-cli
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
This pull request introduces 6 alerts when merging 5eb3b55 into bcf36eb - view on LGTM.com new alerts:
|
This pull request introduces 3 alerts when merging 08bef0d into be1866f - view on LGTM.com new alerts:
|
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
noahsolomon-ms
force-pushed
the
remote-cli
branch
from
August 9, 2022 19:48
08bef0d
to
41e99b8
Compare
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
This pull request introduces 1 alert when merging c1f95ed into 14c483f - view on LGTM.com new alerts:
|
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
Signed-off-by: Noah Solomon <t-nosolomon@microsoft.com>
This pull request introduces 1 alert when merging 2755737 into 7704f63 - view on LGTM.com new alerts:
|
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.
What I did
Added commands
rexec
(remote execute) andrshell
(remote shell) to SONiC command line on chassis supervisors. These commands allow you to execute a command through SSH from a supervisor on a linecard (rexec) or to enter the SSH shell for a linecard (rshell).Additionally, these commands take in linecard names, which are then mapped to linecard IP addresses using the Redis State database.
rexec
command allows you to execute a command on one (or many) linecards.LINECARD_NAMES
One or more linecard names. Tab-completion enabled.-c/--command COMMAND
(required) The command to execute.-p/--password-file
Read password from a file. If not provided, user will be prompted for a password.rexec linecard0 linecard1 --command "show interface status"
rshell
command allows you to access the linecards shell, similar tossh
.LINECARD_NAMES
One or more linecard names. Tab-completion enabled.-p/--password-file
Read password from a file. If not provided, user will be prompted for a password.rshell linecard0
How I did it
I created the
rcli
directory with multiple files that use Click to parse command line inputs. The two relevant files here arerexec.py
andrshell.py
. These files also make use oflinecard.py
, which contains most of the plumbing to initiate and manage SSH connections. This project primarily uses the Paramiko Python library to manage SSH connections.How to verify it
(work in progress)