diff options
author | Christian Breunig <christian@breunig.cc> | 2025-02-19 20:27:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-19 20:27:00 +0100 |
commit | d3398e300e1d5e1861ebac560c105e558a3e10d3 (patch) | |
tree | ca7c99dbb12420fdc6c1b1d8b1d995d24ed0813a | |
parent | d53f448d320515508f32a195c4f9c4a3fe334f0c (diff) | |
parent | 4a049c36bbc35564950b199daa11191d4093fb0d (diff) | |
download | vyos-1x-d3398e300e1d5e1861ebac560c105e558a3e10d3.tar.gz vyos-1x-d3398e300e1d5e1861ebac560c105e558a3e10d3.zip |
Merge pull request #4354 from jestabro/netplug-config
T7182: use Config instead of ConfigTreeQuery for get_interface_dict
-rwxr-xr-x | src/etc/netplug/vyos-netplug-dhcp-client | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/etc/netplug/vyos-netplug-dhcp-client b/src/etc/netplug/vyos-netplug-dhcp-client index 83fed70f0..4cc824afd 100755 --- a/src/etc/netplug/vyos-netplug-dhcp-client +++ b/src/etc/netplug/vyos-netplug-dhcp-client @@ -19,21 +19,22 @@ import sys from time import sleep -from vyos.configquery import ConfigTreeQuery +from vyos.config import Config from vyos.configdict import get_interface_dict from vyos.ifconfig import Interface from vyos.ifconfig import Section from vyos.utils.boot import boot_configuration_complete from vyos.utils.commit import commit_in_progress from vyos import airbag + airbag.enable() if len(sys.argv) < 3: - airbag.noteworthy("Must specify both interface and link status!") + airbag.noteworthy('Must specify both interface and link status!') sys.exit(1) if not boot_configuration_complete(): - airbag.noteworthy("System bootup not yet finished...") + airbag.noteworthy('System bootup not yet finished...') sys.exit(1) interface = sys.argv[1] @@ -47,8 +48,10 @@ while commit_in_progress(): sleep(1) in_out = sys.argv[2] -config = ConfigTreeQuery() +config = Config() interface_path = ['interfaces'] + Section.get_config_path(interface).split() -_, interface_config = get_interface_dict(config, interface_path[:-1], ifname=interface, with_pki=True) +_, interface_config = get_interface_dict( + config, interface_path[:-1], ifname=interface, with_pki=True +) Interface(interface).update(interface_config) |