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:40:58 -0600
commit82ea3b4f3c12023ce17f1062785b6238f457673d (patch)
tree14eaa8abe2cafc18ce8431bf8c8c69f9e1ca5b62 /src
parentd618bbab8ffb4f9439dee0d9a9802b493484f5bf (diff)
downloadvyos-1x-82ea3b4f3c12023ce17f1062785b6238f457673d.tar.gz
vyos-1x-82ea3b4f3c12023ce17f1062785b6238f457673d.zip
http-api: T4003: fix output when no tty attached to stdout, e.g., api
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 3d50eb938..eac068274 100755
--- a/src/op_mode/show_interfaces.py
+++ b/src/op_mode/show_interfaces.py
@@ -94,10 +94,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: