Skip to content
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

[data/etc/bash_completion.d/sonic-clear] Issue: clear tab completion … #269

Merged
merged 1 commit into from
Jun 21, 2018
Merged

[data/etc/bash_completion.d/sonic-clear] Issue: clear tab completion … #269

merged 1 commit into from
Jun 21, 2018

Conversation

praveen-li
Copy link
Member

Issue:
a.) clear tab completion shows garbage value
b.) sonic-clear tab completion does not show correct options
$ clear ^[[3;J^[[H^[[2J
$ sonic-clear
acl-loader crm debug grub insserv psuutil show sonic_installer valgrind
config debconf docker initramfs-tools pfcwd sfputil sonic-clear undebug

Changes :
1.) Have bash_completion function for sonic-clear command instead of clear command.
2.) Use the same completion function for clear[/usr/bin/clear] as well.
3.) Change name of _clear_completion to _sonic_clear_completion.
4.) Replace $1 with "sonic-clear" in _sonic_clear_completion, so that it can be reused for clear.

Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com

- What I did
Fixed issue: clear tab completion shows garbage value
$ clear TAB-TAB ----> $ clear ^[[3;J^[[H^[[2J

- How I did it
Changes :
1.) Have bash_completion function for sonic-clear command instead of clear command.
2.) Use the same completion function for clear[/usr/bin/clear] as well.
3.) Change name of _clear_completion to _sonic_clear_completion.
4.) Replace $1 with "sonic-clear" in _sonic_clear_completion, so that it can be reused for clear.

- How to verify it
Tests:
1.) clear [Enter]
Clears Screen

2.) clear
$ clear
arp bgp counters fdb ip ipv6

3.) clear a
$ clear a
arp

4.) clear counters
$ clear counters
Permission Denied, Please run as root/sudo

5.) clear arp
$ clear arp
fe80::2a6f:7fff:feba:1cff dev eth0 lladdr 28:6f:7f:ba:1c:ff router used 259/319/70 probes 0 STALE
172.25.11.1 dev eth0 lladdr 28:6f:7f:ba:1c:ff ref 1 used 66/0/65 probes 1 REACHABLE

Round 1, deleting 2 entries
Flush is complete after 1 round

6.) $ sonic-clear
arp bgp counters fdb ip ipv6

7.) which clear
/usr/local/bin/clear
- Previous command output (if the output of a command-line utility has changed)
$ clear ^[[3;J^[[H^[[2J

$ sonic-clear

acl-loader crm debug grub insserv psuutil show sonic_installer valgrind
config debconf docker initramfs-tools pfcwd sfputil sonic-clear undebug
- New command output (if the output of a command-line utility has changed)
As per section 3.
-->

…shows garbage value

$ clear ^[[3;J^[[H^[[2J

Changes :
1.) Have bash_completion function for sonic-clear command instead of clear command.
2.) Use the same completion function for clear[/usr/bin/clear] as well.
3.) Change name of _clear_completion to _sonic_clear_completion.
4.) Replace $1 with "sonic-clear" in _sonic_clear_completion, so that it can be reused for clear.

Signed-off-by: Praveen Chaudhary <pchaudhary@linkedin.com>
@qiluo-msft qiluo-msft merged commit a6bf405 into sonic-net:master Jun 21, 2018
@praveen-li praveen-li deleted the clear_tab_completion branch June 25, 2018 21:35
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 18, 2022
This PR adds the following commits in sonic-platform-common

eb35c85[Credo][Ycable] Fix Credo firmware download API download_firmware flag (sonic-net#269)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
mihirpat1 pushed a commit to mihirpat1/sonic-utilities that referenced this pull request Sep 15, 2023
sonic-net#269)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>

Due to PR sonic-net#222
the download_firmware_status variable of download_firmware API was not cleaned up, due to which higher layer
could sometimes see wrong values of firmware version.
This PR addresses this issue.

After calling a firmware download and not changing this variable


admin@sonic:~$ show mux firmware version Ethernet0
{
    "version_nic_active": "N/A",
    "version_nic_inactive": "N/A",
    "version_nic_next": "N/A",
    "version_peer_active": "N/A",
    "version_peer_inactive": "N/A",
    "version_peer_next": "N/A",
    "version_self_active": "N/A",
    "version_self_inactive": "N/A",
    "version_self_next": "N/A"
}
after the change

admin@sonic:~$ show mux firmware version Ethernet0
<versionX>
{
    "version_nic_active": "1.0MS",
    "version_nic_inactive": "1.1MS",
    "version_nic_next": "1.0MS",
    "version_peer_active": "1.0MS",
    "version_peer_inactive": "1.1MS",
    "version_peer_next": "1.0MS",
    "version_self_active": "1.0MS",
    "version_self_inactive": "1.1MS",
    "version_self_next": "1.0MS"
}
Description
Motivation and Context
How Has This Been Tested?
Tested on an Arista Device.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants