-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[docker-mgmt-framework]: update mgmt framework docker to support sonic-cli cmd #6148
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
fcfcc94
update the sonic-cli script
kwangsuk 3aa981d
add dependent libraries for Klish upgrade
kwangsuk d3b1191
add the dependent package libcjson
kwangsuk 55c5126
remove redudandt install
kwangsuk 3fa0a72
migrate sonic-cli to python3
kwangsuk b7a8a54
Revert "migrate sonic-cli to python3"
kwangsuk cfd9d53
migrate sonic-cli to python3 upport
kwangsuk b1f468d
Merge branch 'master' into update-sonic-cli
kwangsuk c094f75
pip3 install mmh3
kwangsuk 094f950
Merge branch 'master' into update-sonic-cli
kwangsuk 0d0a847
Update Dockerfile.j2
kwangsuk 182e6fc
Update Dockerfile.j2
kwangsuk d7317e1
Merge branch 'master' into update-sonic-cli
kwangsuk 43c95f3
add the TODO comment to remove soft links
kwangsuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
21 changes: 19 additions & 2 deletions
21
dockers/docker-sonic-mgmt-framework/base_image_files/sonic-cli
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,21 @@ | ||
| #!/bin/bash | ||
|
|
||
| docker exec -it mgmt-framework /usr/sbin/cli/clish_start "$@" | ||
|
|
||
| # Disallow CLI for the root user, since we don't have auth certs for root | ||
| if [[ "$(id -u)" == 0 ]] | ||
| then | ||
| echo "FATAL: root cannot launch CLI" >&2 | ||
| exit 1 | ||
| fi | ||
| TIMEOUT=605 | ||
| if [[ "$1" =~ "prompt=" ]] | ||
| then | ||
| SYSTEM_NAME=`echo $1 | cut -d"=" -f2` | ||
| shift | ||
| docker exec -e SYSTEM_NAME=$SYSTEM_NAME -e CLI_USER="$USER" -u $(id -u):$(id -g) -it mgmt-framework /usr/sbin/cli/clish_start -t "$TIMEOUT" "$@" | ||
| else | ||
| docker exec -e CLI_USER="$USER" -e SYSTEM_NAME=$HOSTNAME -u $(id -u):$(id -g) -it mgmt-framework /usr/sbin/cli/clish_start -t "$TIMEOUT" "$@" | ||
| fi | ||
| ret=$? | ||
| if [ $ret -ne 0 ]; then | ||
| [[ -e /tmp/fast-reboot-progress || -e /tmp/reboot-progress ]] && sleep infinity | ||
| fi |
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
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.
Uh oh!
There was an error while loading. Please reload this page.