Page MenuHomeVyOS Platform

No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None
diff --git a/src/etc/netplug/vyos-netplug-dhcp-client b/src/etc/netplug/vyos-netplug-dhcp-client
index 8afc9fda9..4cc824afd 100755
--- a/src/etc/netplug/vyos-netplug-dhcp-client
+++ b/src/etc/netplug/vyos-netplug-dhcp-client
@@ -1,57 +1,57 @@
#!/usr/bin/env python3
#
# Copyright 2023-2025 VyOS maintainers and contributors <maintainers@vyos.io>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
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!')
sys.exit(1)
if not boot_configuration_complete():
airbag.noteworthy('System bootup not yet finished...')
sys.exit(1)
interface = sys.argv[1]
# helper scripts should only work on physical interfaces not on individual
# sub-interfaces. Moving e.g. a VLAN interface in/out a VRF will also trigger
# this script which should be prohibited - bail out early
if '.' in interface:
sys.exit(0)
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(interface).update(interface_config)

File Metadata

Mime Type
text/x-diff
Expires
Fri, Nov 6, 6:20 AM (18 m, 18 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4652703
Default Alt Text
(2 KB)

Event Timeline