Skip to content

Commit ba68aed

Browse files
authored
do not parse stderr to get correct routing stack (sonic-net#1398)
ignore the message printed on stderr sonic:$ show ip bgp sum usermod: Permission denied. usermod: cannot lock /etc/passwd; try again later. usermod: Permission denied. usermod: cannot lock /etc/passwd; try again later. Signed-off-by: Guohan Lu <[email protected]>
1 parent aa7b90e commit ba68aed

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

clear/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ def get_routing_stack():
7878
proc = subprocess.Popen(command,
7979
stdout=subprocess.PIPE,
8080
shell=True,
81-
text=True,
82-
stderr=subprocess.STDOUT)
81+
text=True)
8382
stdout = proc.communicate()[0]
8483
proc.wait()
8584
result = stdout.rstrip('\n')

show/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ def get_routing_stack():
5757
proc = subprocess.Popen(command,
5858
stdout=subprocess.PIPE,
5959
shell=True,
60-
text=True,
61-
stderr=subprocess.STDOUT)
60+
text=True)
6261
stdout = proc.communicate()[0]
6362
proc.wait()
6463
result = stdout.rstrip('\n')

0 commit comments

Comments
 (0)