From 292b064d743522d11179bd3cd91a08731380f3a9 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Fri, 4 Aug 2023 20:12:23 +0200 Subject: dhcp: T5428: provide common direcotry path via vyos.defaults.directories Multiple scripts use the same hardcoded path for DHCP client leases in different direcotries - this can't be worse. --- python/vyos/ifconfig/interface.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'python/vyos/ifconfig') diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index 99ddb2021..fe8752d24 100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -31,6 +31,7 @@ from vyos import ConfigError from vyos.configdict import list_diff from vyos.configdict import dict_merge from vyos.configdict import get_vlan_ids +from vyos.defaults import directories from vyos.template import render from vyos.utils.network import mac2eui64 from vyos.utils.dict import dict_search @@ -1240,7 +1241,7 @@ class Interface(Control): raise ValueError() ifname = self.ifname - config_base = r'/var/lib/dhcp/dhclient' + config_base = directories['isc_dhclient_dir'] + '/dhclient' config_file = f'{config_base}_{ifname}.conf' options_file = f'{config_base}_{ifname}.options' pid_file = f'{config_base}_{ifname}.pid' -- cgit v1.2.3