summaryrefslogtreecommitdiff
path: root/python/vyos/ifconfig/interface.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-11-16 20:05:08 +0100
committerChristian Breunig <christian@breunig.cc>2023-11-16 20:07:12 +0100
commitc8ba5dccfa9b02533c6536903ecacd3ddb04351e (patch)
tree2d85295e867d8a961ba52d13942e9f1deccbb349 /python/vyos/ifconfig/interface.py
parent019723aaa4217403f1fcbcd636f573ea403f909c (diff)
downloadvyos-1x-c8ba5dccfa9b02533c6536903ecacd3ddb04351e.tar.gz
vyos-1x-c8ba5dccfa9b02533c6536903ecacd3ddb04351e.zip
tunnel: T3894: improve get_mac_synthetic() code
Remove stray whitespace in sed script and call Section.interfaces with vlan=False instead of a custom filter. This extends commit f19c92f25 ("tunnel: T3894: fix design when building synthetic MAC addresses")
Diffstat (limited to 'python/vyos/ifconfig/interface.py')
-rw-r--r--python/vyos/ifconfig/interface.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py
index 31640385c..1586710db 100644
--- a/python/vyos/ifconfig/interface.py
+++ b/python/vyos/ifconfig/interface.py
@@ -496,12 +496,12 @@ class Interface(Control):
from hashlib import sha256
# Get processor ID number
- cpu_id = self._cmd('sudo dmidecode -t 4 | grep ID | head -n1 | sed "s/.*ID://;s/ //g"')
+ cpu_id = self._cmd('sudo dmidecode -t 4 | grep ID | head -n1 | sed "s/.*ID://;s/ //g"')
# XXX: T3894 - it seems not all systems have eth0 - get a list of all
# available Ethernet interfaces on the system (without VLAN subinterfaces)
# and then take the first one.
- all_eth_ifs = [x for x in Section.interfaces('ethernet') if '.' not in x]
+ all_eth_ifs = Section.interfaces('ethernet', vlan=False)
first_mac = Interface(all_eth_ifs[0]).get_mac()
sha = sha256()