From dfaae69678da80a0e5bc7b8c2d9b846ab80b6b19 Mon Sep 17 00:00:00 2001 From: Arun Saravanan Balachandran <52521751+ArunSaravananBalachandran@users.noreply.github.com> Date: Mon, 3 Aug 2020 09:50:21 +0000 Subject: [PATCH] [lldpshow]: Fix input device is not a TTY error (#1016) Fix Azure/sonic-buildimage#5019 Fix "the input device is not a TTY" error reported by 'show lldp' commands when executed via pytest scripts in sonic-mgmt. --- scripts/lldpshow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lldpshow b/scripts/lldpshow index 42d5fa39ac6f..3d53df13db68 100755 --- a/scripts/lldpshow +++ b/scripts/lldpshow @@ -74,7 +74,7 @@ class Lldpshow(object): lldp_interface_list = lldp_port if lldp_port is not None else self.lldp_interface[lldp_instace_num] # In detail mode we will pass interface list (only front ports) and get O/P as plain text # and in table format we will get xml output - lldp_cmd = 'sudo docker exec -it lldp{} lldpctl '.format(self.lldp_instance[lldp_instace_num]) + ('-f xml' if not lldp_detail_info else lldp_interface_list) + lldp_cmd = 'sudo docker exec -i lldp{} lldpctl '.format(self.lldp_instance[lldp_instace_num]) + ('-f xml' if not lldp_detail_info else lldp_interface_list) p = subprocess.Popen(lldp_cmd, stdout=subprocess.PIPE, shell=True) (output, err) = p.communicate() ## Wait for end of command. Get return returncode ##