Skip to content

Commit

Permalink
[show] fix get routing stack routine (#2137)
Browse files Browse the repository at this point in the history
- What I did
Fixed error message: "Failed to get routing stack: a bytes-like object is required, not 'str'" introduced by #2117

- How I did it
Add missing 'text' parameter

- How to verify it
Run on switch

Signed-off-by: Stepan Blyschak <[email protected]>
  • Loading branch information
stepanblyschak authored and judyjoseph committed May 2, 2022
1 parent c888f29 commit 5837559
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_routing_stack():
command = "sudo docker ps | grep bgp | awk '{print$2}' | cut -d'-' -f3 | cut -d':' -f1 | head -n 1"

try:
stdout = subprocess.check_output(command, shell=True, timeout=COMMAND_TIMEOUT)
stdout = subprocess.check_output(command, shell=True, text=True, timeout=COMMAND_TIMEOUT)
result = stdout.rstrip('\n')
except Exception as err:
click.echo('Failed to get routing stack: {}'.format(err), err=True)
Expand Down

0 comments on commit 5837559

Please sign in to comment.