diff options
author | Christian Breunig <christian@breunig.cc> | 2023-11-16 20:05:08 +0100 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2023-11-16 20:07:44 +0100 |
commit | a017d2337d8ea6957ca23f63e418ac14b7921fd3 (patch) | |
tree | 5e1d9a2c032cd761ba438d326a65cdd98a84c039 /python/vyos/ifconfig/interface.py | |
parent | 777a2a249294cf275655adacc3cf66528e8d1fe1 (diff) | |
download | vyos-1x-a017d2337d8ea6957ca23f63e418ac14b7921fd3.tar.gz vyos-1x-a017d2337d8ea6957ca23f63e418ac14b7921fd3.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")
(cherry picked from commit c8ba5dccfa9b02533c6536903ecacd3ddb04351e)
Diffstat (limited to 'python/vyos/ifconfig/interface.py')
-rw-r--r-- | python/vyos/ifconfig/interface.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index b8f947d65..8783ccc1e 100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -488,12 +488,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() |