diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-04-04 17:11:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-04 17:11:21 +0200 |
commit | e7891a830aa25ae13ccfbe7b401a8262908387d9 (patch) | |
tree | 7265200f33e44fa3235bdf981822f2a245c654d2 /src | |
parent | fe87ed94a3af6b97d2481e96c63d48ba87849627 (diff) | |
parent | 5cb8e78626988b9bad6dfe9122101c36d116afbf (diff) | |
download | vyos-1x-e7891a830aa25ae13ccfbe7b401a8262908387d9.tar.gz vyos-1x-e7891a830aa25ae13ccfbe7b401a8262908387d9.zip |
Merge pull request #3214 from nicolas-fort/T6068-kea
T6068: dhcp-server: add command <set service dhcp-server high-availability mode>
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/service_dhcp-server.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/conf_mode/service_dhcp-server.py b/src/conf_mode/service_dhcp-server.py index bf4454fda..f4fb78f57 100755 --- a/src/conf_mode/service_dhcp-server.py +++ b/src/conf_mode/service_dhcp-server.py @@ -143,8 +143,12 @@ def get_config(config=None): dhcp['shared_network_name'][network]['subnet'][subnet].update( {'range' : new_range_dict}) - if dict_search('high_availability.certificate', dhcp): - dhcp['pki'] = conf.get_config_dict(['pki'], key_mangling=('-', '_'), get_first_key=True, no_tag_node_value_mangle=True) + if len(dhcp['high_availability']) == 1: + ## only default value for mode is set, need to remove ha node + del dhcp['high_availability'] + else: + if dict_search('high_availability.certificate', dhcp): + dhcp['pki'] = conf.get_config_dict(['pki'], key_mangling=('-', '_'), get_first_key=True, no_tag_node_value_mangle=True) return dhcp |