From c8f4cbb39e436f79ee5dc31f1701c999e2061674 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 27 Nov 2023 13:12:24 -0500 Subject: [PATCH] Fix node entry keys --- api-daemon/pvcapid/Daemon.py | 3 ++- node-daemon/pvcnoded/util/config.py | 32 +++++++++++++++++++---------- pvc.sample.conf | 4 +++- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/api-daemon/pvcapid/Daemon.py b/api-daemon/pvcapid/Daemon.py index 0c61181d..781914ce 100755 --- a/api-daemon/pvcapid/Daemon.py +++ b/api-daemon/pvcapid/Daemon.py @@ -99,7 +99,8 @@ def get_configuration_current(config_file): # Create the config object config = { "debug": strtobool(o_config["logging"].get("debug_logging", "False")), - "coordinators": o_config["cluster"]["all_coordinators"], + "all_nodes": o_config["cluster"]["all_nodes"], + "coordinators": o_config["cluster"]["coordinator_nodes"], "listen_address": o_config["api"]["listen"]["address"], "listen_port": int(o_config["api"]["listen"]["port"]), "auth_enabled": strtobool( diff --git a/node-daemon/pvcnoded/util/config.py b/node-daemon/pvcnoded/util/config.py index fa1efcf9..ff81a979 100644 --- a/node-daemon/pvcnoded/util/config.py +++ b/node-daemon/pvcnoded/util/config.py @@ -168,7 +168,7 @@ def get_configuration_current(config_file): "plugin_directory", "/usr/share/pvc/plugins" ), "dynamic_directory": o_path["dynamic_directory"], - "log_directory": o_path["log_directory"], + "log_directory": o_path["system_log_directory"], "console_log_directory": o_path["console_log_directory"], "ceph_directory": o_path["ceph_directory"], } @@ -178,7 +178,7 @@ def get_configuration_current(config_file): config_cluster = { "cluster_name": o_cluster["name"], "all_nodes": o_cluster["all_nodes"], - "coordinators": o_cluster["all_coordinators"], + "coordinators": o_cluster["coordinator_nodes"], } config = {**config, **config_cluster} @@ -193,20 +193,25 @@ def get_configuration_current(config_file): "network_address" ] + "/" - + o_cluster_networks_specific["ipv4"]["netmask"], + + str(o_cluster_networks_specific["ipv4"]["netmask"]), f"{network_type}_floating_ip": o_cluster_networks_specific["ipv4"][ "floating_address" ] + "/" - + o_cluster_networks_specific["ipv4"]["netmask"], - f"{network_type}_gateway": o_cluster_networks_specific["ipv4"][ - "gateway_address" - ], + + str(o_cluster_networks_specific["ipv4"]["netmask"]), f"{network_type}_node_ip_selection": o_cluster_networks_specific[ "node_ip_selection" ], } + if ( + o_cluster_networks_specific["ipv4"].get("gateway_address", None) + is not None + ): + config_cluster_networks_specific[ + "{network_type}_gateway" + ] = o_cluster_networks_specific["ipv4"]["gateway_address"] + result, msg = validate_floating_ip( config_cluster_networks_specific, network_type ) @@ -217,7 +222,10 @@ def get_configuration_current(config_file): config_cluster_networks_specific[f"{network_type}_network"] ) - if config["upstream_node_ip_selection"] == "static": + if ( + config_cluster_networks_specific[f"{network_type}_node_ip_selection"] + == "static" + ): with open(config["node_ip_file"], "r") as ipfh: ip_last_octet = ipfh.read().strip() address_id = [ @@ -275,7 +283,7 @@ def get_configuration_current(config_file): o_fencing = o_config["fencing"] config_fencing = { - "disable_on_ipmi_failure": o_fencing["disble_on_ipmi_failure"], + "disable_on_ipmi_failure": o_fencing["disable_on_ipmi_failure"], "fence_intervals": int(o_fencing["intervals"].get("fence_intervals", 6)), "suicide_intervals": int(o_fencing["intervals"].get("suicide_interval", 0)), "successful_fence": o_fencing["actions"].get("successful_fence", None), @@ -645,9 +653,11 @@ def get_configuration(): pvc_config_file, pvc_config_type = get_configuration_path() if pvc_config_type == "legacy": - return get_configuration_legacy(pvc_config_file) + config = get_configuration_legacy(pvc_config_file) else: - return get_configuration_current(pvc_config_file) + config = get_configuration_current(pvc_config_file) + + return config def validate_directories(config): diff --git a/pvc.sample.conf b/pvc.sample.conf index 525186b6..9f99c313 100644 --- a/pvc.sample.conf +++ b/pvc.sample.conf @@ -205,7 +205,9 @@ timer: # Fencing configuration fencing: - # Disable fencing or not on IPMI failure at startup for remainder of daemon run + # Disable fencing or not on IPMI failure at startup + # Setting this value to "no" will allow fencing to be enabled even if does not respond during node daemon + # startup. This will allow future fencing to be attempted if it later recovers. disable_on_ipmi_failure: no # Fencing intervals