diff options
author | Nicolas Fort <nicolasfort1988@gmail.com> | 2024-03-27 17:16:53 +0000 |
---|---|---|
committer | Nicolas Fort <nicolasfort1988@gmail.com> | 2024-04-03 11:32:47 +0000 |
commit | 5cb8e78626988b9bad6dfe9122101c36d116afbf (patch) | |
tree | fb2b4bcd3e0823b37806d1ceb10eea727d7e88a9 /src/conf_mode | |
parent | 0fcab52921f27f8d2df9038a193be66c2ba18d11 (diff) | |
download | vyos-1x-5cb8e78626988b9bad6dfe9122101c36d116afbf.tar.gz vyos-1x-5cb8e78626988b9bad6dfe9122101c36d116afbf.zip |
T6068: dhcp-server: add command <set service dhcp-server high-availability mode> so user can define what type of ha use: active-active or active-passive
Diffstat (limited to 'src/conf_mode')
-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 ba3d69b07..518625ffc 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 |