summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2021-11-19 15:37:39 -0600
committerJohn Estabrook <jestabro@vyos.io>2021-11-19 15:47:37 -0600
commite7c3137708652bea9c0f8b5fe703717bb6f49d84 (patch)
treeda5eb0507af88faecd2101fd06177841d4aac33a /src
parent783dcc13e22be9d81179ab986062a12ed49cd601 (diff)
downloadvyos-1x-e7c3137708652bea9c0f8b5fe703717bb6f49d84.tar.gz
vyos-1x-e7c3137708652bea9c0f8b5fe703717bb6f49d84.zip
http-api: T4003: fix output when no tty attached to stdout, e.g., api
(cherry picked from commit 82ea3b4f3c12023ce17f1062785b6238f457673d)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/op_mode/show_interfaces.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/op_mode/show_interfaces.py b/src/op_mode/show_interfaces.py
index aef2d8060..281d25e30 100755
--- a/src/op_mode/show_interfaces.py
+++ b/src/op_mode/show_interfaces.py
@@ -85,10 +85,8 @@ def split_text(text, used=0):
used: number of characted already used in the screen
"""
no_tty = call('tty -s')
- if no_tty:
- return text.split()
- returned = cmd('stty size')
+ returned = cmd('stty size') if not no_tty else ''
if len(returned) == 2:
rows, columns = [int(_) for _ in returned]
else: