diff options
author | Christian Breunig <christian@breunig.cc> | 2023-08-04 20:12:23 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2023-08-04 20:12:23 +0200 |
commit | 292b064d743522d11179bd3cd91a08731380f3a9 (patch) | |
tree | 37928a579f4624a447ad46277e43e966f03881ae /python/vyos/ifconfig | |
parent | 3aac2941efc473c5d52cf9271d778bd51a72dfc7 (diff) | |
download | vyos-1x-292b064d743522d11179bd3cd91a08731380f3a9.tar.gz vyos-1x-292b064d743522d11179bd3cd91a08731380f3a9.zip |
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.
Diffstat (limited to 'python/vyos/ifconfig')
-rw-r--r-- | python/vyos/ifconfig/interface.py | 3 |
1 files changed, 2 insertions, 1 deletions
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' |