summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces_ethernet.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-01-04 07:56:35 +0100
committerGitHub <noreply@github.com>2024-01-04 07:56:35 +0100
commitada6b103f15b5871fa28c5e194afcd2f5019b2e4 (patch)
treec8c6cdbdeccd48ff60a0ef6b0b6ed0d339687969 /src/conf_mode/interfaces_ethernet.py
parentc08fea7a5d98e1626788280ac51f7131f3f29308 (diff)
parentb152b52023ba0cf0d4919eae39e92de28a458917 (diff)
downloadvyos-1x-ada6b103f15b5871fa28c5e194afcd2f5019b2e4.tar.gz
vyos-1x-ada6b103f15b5871fa28c5e194afcd2f5019b2e4.zip
Merge pull request #2750 from c-po/configdict-T5894
configdict: T5894: add get_config_dict() flag with_pki
Diffstat (limited to 'src/conf_mode/interfaces_ethernet.py')
-rwxr-xr-xsrc/conf_mode/interfaces_ethernet.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/conf_mode/interfaces_ethernet.py b/src/conf_mode/interfaces_ethernet.py
index 7374a29f7..2c0f846c3 100755
--- a/src/conf_mode/interfaces_ethernet.py
+++ b/src/conf_mode/interfaces_ethernet.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2019-2021 VyOS maintainers and contributors
+# Copyright (C) 2019-2024 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -150,19 +150,12 @@ def get_config(config=None):
else:
conf = Config()
- # This must be called prior to get_interface_dict(), as this function will
- # alter the config level (config.set_level())
- pki = conf.get_config_dict(['pki'], key_mangling=('-', '_'),
- get_first_key=True, no_tag_node_value_mangle=True)
-
base = ['interfaces', 'ethernet']
- ifname, ethernet = get_interface_dict(conf, base)
+ ifname, ethernet = get_interface_dict(conf, base, with_pki=True)
+
if 'is_bond_member' in ethernet:
update_bond_options(conf, ethernet)
- if 'deleted' not in ethernet:
- if pki: ethernet['pki'] = pki
-
tmp = is_node_changed(conf, base + [ifname, 'speed'])
if tmp: ethernet.update({'speed_duplex_changed': {}})
@@ -171,8 +164,6 @@ def get_config(config=None):
return ethernet
-
-
def verify_speed_duplex(ethernet: dict, ethtool: Ethtool):
"""
Verify speed and duplex