summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-04-04 17:11:21 +0200
committerGitHub <noreply@github.com>2024-04-04 17:11:21 +0200
commite7891a830aa25ae13ccfbe7b401a8262908387d9 (patch)
tree7265200f33e44fa3235bdf981822f2a245c654d2 /src
parentfe87ed94a3af6b97d2481e96c63d48ba87849627 (diff)
parent5cb8e78626988b9bad6dfe9122101c36d116afbf (diff)
downloadvyos-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-xsrc/conf_mode/service_dhcp-server.py8
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