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

[show] [lldp] Fix error 'the input device is not a TTY' when running 'show lldp table/neighbor' #1067

Merged
merged 1 commit into from
Aug 25, 2020

Conversation

bingwang-ms
Copy link
Contributor

@bingwang-ms bingwang-ms commented Aug 24, 2020

- What I did
This PR is to fix sonic-net/sonic-buildimage#5239
The command 'show lldp table/neighbor' always return error message 'the input device is not a TTY' when running in a SSH command or running with Ansible. This commit is to fix this issue.

This is a backport of #1016 to the 201911 branch.

ssh [email protected] "show lldp table"   
the input device is not a TTY

ssh [email protected] "show lldp neighbors" 
the input device is not a TTY

- How I did it
Update lldpshow. Replace the -it in docker exec with -i, because there is no need for a pseudo-TTY when running in command line.
- How to verify it
Verify on Arista-7260.
Before update:

ssh [email protected] "show lldp table"   
the input device is not a TTY

ssh [email protected] "show lldp neighbors" 
the input device is not a TTY

After Update:

ssh [email protected] "show lldp table"   
Capability codes: (R) Router, (B) Bridge, (O) Other
LocalPort    RemoteDevice    RemotePortID    Capability    RemotePortDescr
-----------  --------------  --------------  ------------  -----------------
Ethernet48   ARISTA01T1      Ethernet1       BR
Ethernet52   ARISTA01T1      Ethernet2       BR
Ethernet56   ARISTA02T1      Ethernet1       BR
Ethernet60   ARISTA02T1      Ethernet2       BR
Ethernet64   ARISTA03T1      Ethernet1       BR
Ethernet68   ARISTA03T1      Ethernet2       BR
Ethernet72   ARISTA04T1      Ethernet1       BR
Ethernet76   ARISTA04T1      Ethernet2       BR
eth0         2200-ACS-1      ge-0/0/29       BR            ge-0/0/29.0
--------------------------------------------------
Total entries displayed:  9

ssh [email protected] "show lldp neighbor"
-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
Interface:    eth0, via: LLDP, RID: 5, Time: 0 day, 02:35:29
  Chassis:     
    ChassisID:    mac dc:38:e1:96:ce:c0
    SysName:      2200-ACS-1
    SysDescr:     Juniper Networks, Inc. ex2200-48t-4g , version 12.3R6.6 Build date: 2014-03-13 07:02:54 UTC 
    TTL:          90
    Capability:   Bridge, on
    Capability:   Router, on
  Port:        
    PortID:       ifname ge-0/0/29
    PortDescr:    ge-0/0/29.0
    MFS:          1514
    PMD autoneg:  supported: yes, enabled: yes
      Adv:          10Base-T, HD: yes, FD: yes
      Adv:          100Base-TX, HD: yes, FD: yes
      Adv:          1000Base-T, HD: no, FD: yes
      MAU oper type: unknown
......

- Previous command output (if the output of a command-line utility has changed)
N/A
- New command output (if the output of a command-line utility has changed)
N/A

…ugh SSH command.

The command 'show lldp table/neighbor' always return error message 'the
input device is not a TTY' when running in a SSH command or running with
Ansible. This commit is to fix this issue.
@lguohan
Copy link
Contributor

lguohan commented Aug 24, 2020

i think there is another one on the master for the same fix.

@bingwang-ms
Copy link
Contributor Author

i think there is another one on the master for the same fix.

Yes. I just saw that. So do we need to merge this PR on branch 201911?

@jleveque
Copy link
Contributor

It looks like the affected statement was broken into two lines in the 201911 branch, so the master PR might not cherry-pick cleanly. We can merge this PR to 201911.

@jleveque
Copy link
Contributor

I updated the PR description to add the note, "This is a backport of #1016 to the 201911 branch."

@jleveque
Copy link
Contributor

Retest this please

1 similar comment
@bingwang-ms
Copy link
Contributor Author

Retest this please

@bingwang-ms bingwang-ms merged commit b0ac781 into sonic-net:201911 Aug 25, 2020
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
Fix error when running 'show lldp table' or 'show lldp neighbor'
through SSH command. (sonic-net#1067)
[201911]: Multi asic show interface support (sonic-net#1070)
[counterpoll] Add new FC group for port buffer drop counters
(sonic-net#1024)
[201911] show interface portchannel support for Multi ASIC
(sonic-net#1071)
Fix a typo in mellanox_buffer_migrator (sonic-net#1090)
Fix pfcwd stats crash with invalid queue name (sonic-net#1077)
[PFCWD] Fix issue with "pfcwd show stats" command during SONiC init
(sonic-net#1018)
enable watchdog before running platform specific reboot plugin
(sonic-net#1037)
Add namespace of the process in the coredump filename. (sonic-net#1091)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants