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:43:22 +0100
commit426b5a76e1e251d122d5b2e17c5a39b4298b5071 (patch)
tree412ecf6d22fc50d48b1cd5d800588c09ef040401 /python
parent4f4362736de7a8d75ad31c158e7964e65cc4b1bd (diff)
downloadvyos-1x-426b5a76e1e251d122d5b2e17c5a39b4298b5071.tar.gz
vyos-1x-426b5a76e1e251d122d5b2e17c5a39b4298b5071.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. (cherry picked from commit ea1be032e98fd1634e71d3c2d61b3e93bff841de)
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}',