summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-05-03 13:28:11 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-05-04 20:58:06 +0200
commitc1ad2a6461fc2e767d69567be9647150c3310569 (patch)
tree52103aab1a34198fcf990d2a1c8c3ce4858384e0
parent9bfbb24ae649d7cedc2002f7df95a0aa0fececdc (diff)
downloadvyos-1x-c1ad2a6461fc2e767d69567be9647150c3310569.tar.gz
vyos-1x-c1ad2a6461fc2e767d69567be9647150c3310569.zip
configdict: T2241: get interface name in intf/vlan_from_dict
This is needed as later functions depend on it
-rw-r--r--python/vyos/configdict.py2
-rwxr-xr-xsrc/conf_mode/interfaces-bonding.py1
-rwxr-xr-xsrc/conf_mode/interfaces-ethernet.py1
-rwxr-xr-xsrc/conf_mode/interfaces-pseudo-ethernet.py1
4 files changed, 2 insertions, 3 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py
index 943092ceb..cd3364c94 100644
--- a/python/vyos/configdict.py
+++ b/python/vyos/configdict.py
@@ -23,6 +23,7 @@ from copy import deepcopy
from vyos import ConfigError
from vyos.ifconfig import Interface
+from vyos.util import ifname_from_config
def retrieve_config(path_hash, base_path, config):
@@ -197,6 +198,7 @@ def intf_to_dict(conf, default):
"""
intf = deepcopy(default)
+ intf['intf'] = ifname_from_config(conf)
# retrieve configured interface addresses
if conf.exists('address'):
diff --git a/src/conf_mode/interfaces-bonding.py b/src/conf_mode/interfaces-bonding.py
index a174e33e4..76caefabe 100755
--- a/src/conf_mode/interfaces-bonding.py
+++ b/src/conf_mode/interfaces-bonding.py
@@ -119,7 +119,6 @@ def get_config():
conf.set_level(cfg_base)
bond, disabled = intf_to_dict(conf, default_config_data)
- bond['intf'] = ifname
# ARP link monitoring frequency in milliseconds
if conf.exists('arp-monitor interval'):
diff --git a/src/conf_mode/interfaces-ethernet.py b/src/conf_mode/interfaces-ethernet.py
index 3ddd394d7..c7f935ca6 100755
--- a/src/conf_mode/interfaces-ethernet.py
+++ b/src/conf_mode/interfaces-ethernet.py
@@ -92,7 +92,6 @@ def get_config():
conf.set_level(cfg_base)
eth, disabled = intf_to_dict(conf, default_config_data)
- eth['intf'] = ifname
# disable ethernet flow control (pause frames)
if conf.exists('disable-flow-control'):
diff --git a/src/conf_mode/interfaces-pseudo-ethernet.py b/src/conf_mode/interfaces-pseudo-ethernet.py
index f0f893b44..67250ec9f 100755
--- a/src/conf_mode/interfaces-pseudo-ethernet.py
+++ b/src/conf_mode/interfaces-pseudo-ethernet.py
@@ -85,7 +85,6 @@ def get_config():
conf.set_level(cfg_base)
peth, disabled = intf_to_dict(conf, default_config_data)
- peth['intf'] = ifname
# ARP cache entry timeout in seconds
if conf.exists(['ip', 'arp-cache-timeout']):