diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-06-20 22:33:11 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-06-20 22:33:11 +0200 |
commit | 5d6f3db6a0a6e65a9eb81cede4c59c7d22f2cae0 (patch) | |
tree | d09796e37e2671f59746e04a0a63e7fabe13ede2 /src | |
parent | 7e258d0f77c005baf27a50160aa8b82b8562975c (diff) | |
download | vyos-1x-5d6f3db6a0a6e65a9eb81cede4c59c7d22f2cae0.tar.gz vyos-1x-5d6f3db6a0a6e65a9eb81cede4c59c7d22f2cae0.zip |
op-mode: T2621: fix repeated interface description
Diffstat (limited to 'src')
-rwxr-xr-x | src/op_mode/show_interfaces.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/op_mode/show_interfaces.py b/src/op_mode/show_interfaces.py index ebb3508f0..46571c0c0 100755 --- a/src/op_mode/show_interfaces.py +++ b/src/op_mode/show_interfaces.py @@ -96,10 +96,14 @@ def split_text(text, used=0): line = '' for word in text.split(): - if len(line) + len(word) >= desc_len: - yield f'{line} {word}'[1:] - line = '' - line = f'{line} {word}' + if len(line) + len(word) < desc_len: + line = f'{line} {word}' + continue + if line: + yield line[1:] + else: + line = f'{line} {word}' + yield line[1:] |