summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-01-13 21:41:20 +0100
committerChristian Poessinger <christian@poessinger.com>2021-01-13 21:41:20 +0100
commitea1be032e98fd1634e71d3c2d61b3e93bff841de (patch)
tree6c9fa4e30f192baeb0310c361b45a242f65508a9 /python
parent57fca79636b783dc4be2df1bc1ff12a0ce79d988 (diff)
downloadvyos-1x-ea1be032e98fd1634e71d3c2d61b3e93bff841de.tar.gz
vyos-1x-ea1be032e98fd1634e71d3c2d61b3e93bff841de.zip
ifconfig: T2653: return empty string when there is no interface description
After switching to iproute2 in commit 92f36735 ("ifconfig: T2653: use iproute2 commands for alias, mac and mtu set()/get()" it is necessary to return an empty string as iproute2 returns None.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/interface.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py
index ba0a8adc0..1561d340e 100644
--- a/python/vyos/ifconfig/interface.py
+++ b/python/vyos/ifconfig/interface.py
@@ -81,7 +81,7 @@ class Interface(Control):
},
'alias': {
'shellcmd': 'ip -json -detail link list dev {ifname}',
- 'format': lambda j: jmespath.search('[*].ifalias | [0]', json.loads(j)),
+ 'format': lambda j: jmespath.search('[*].ifalias | [0]', json.loads(j)) or '',
},
'mac': {
'shellcmd': 'ip -json -detail link list dev {ifname}',