summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-ethernet.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-01-07 22:59:55 +0100
committerChristian Poessinger <christian@poessinger.com>2021-01-07 23:23:53 +0100
commitaa7b5972d48ad05824bfffdf1c5df5a6c2b1e37b (patch)
treedca2a89d965d80e4b31028a39df18616f84fe464 /src/conf_mode/interfaces-ethernet.py
parentfde684497e9be82123cffefa3e4766689e4dabc6 (diff)
downloadvyos-1x-aa7b5972d48ad05824bfffdf1c5df5a6c2b1e37b.tar.gz
vyos-1x-aa7b5972d48ad05824bfffdf1c5df5a6c2b1e37b.zip
vyos.configverify: provide generic helper to check for interface existence
Diffstat (limited to 'src/conf_mode/interfaces-ethernet.py')
-rwxr-xr-xsrc/conf_mode/interfaces-ethernet.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/conf_mode/interfaces-ethernet.py b/src/conf_mode/interfaces-ethernet.py
index bc102826f..0a904c592 100755
--- a/src/conf_mode/interfaces-ethernet.py
+++ b/src/conf_mode/interfaces-ethernet.py
@@ -23,13 +23,13 @@ from vyos.config import Config
from vyos.configdict import get_interface_dict
from vyos.configverify import verify_address
from vyos.configverify import verify_dhcpv6
+from vyos.configverify import verify_eapol
from vyos.configverify import verify_interface_exists
+from vyos.configverify import verify_mirror
from vyos.configverify import verify_mtu
from vyos.configverify import verify_mtu_ipv6
from vyos.configverify import verify_vlan_config
from vyos.configverify import verify_vrf
-from vyos.configverify import verify_eapol
-from vyos.configverify import verify_mirror
from vyos.ifconfig import EthernetIf
from vyos.template import render
from vyos.util import call
@@ -59,7 +59,8 @@ def verify(ethernet):
if 'deleted' in ethernet:
return None
- verify_interface_exists(ethernet)
+ ifname = ethernet['ifname']
+ verify_interface_exists(ifname)
if ethernet.get('speed', None) == 'auto':
if ethernet.get('duplex', None) != 'auto':
@@ -77,7 +78,6 @@ def verify(ethernet):
verify_eapol(ethernet)
verify_mirror(ethernet)
- ifname = ethernet['ifname']
# verify offloading capabilities
if 'offload' in ethernet and 'rps' in ethernet['offload']:
if not os.path.exists(f'/sys/class/net/{ifname}/queues/rx-0/rps_cpus'):