Fix node entry keys

This commit is contained in:
Joshua Boniface 2023-11-27 13:12:24 -05:00
parent 786fae7769
commit c8f4cbb39e
3 changed files with 26 additions and 13 deletions

View File

@ -99,7 +99,8 @@ def get_configuration_current(config_file):
# Create the config object # Create the config object
config = { config = {
"debug": strtobool(o_config["logging"].get("debug_logging", "False")), "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_address": o_config["api"]["listen"]["address"],
"listen_port": int(o_config["api"]["listen"]["port"]), "listen_port": int(o_config["api"]["listen"]["port"]),
"auth_enabled": strtobool( "auth_enabled": strtobool(

View File

@ -168,7 +168,7 @@ def get_configuration_current(config_file):
"plugin_directory", "/usr/share/pvc/plugins" "plugin_directory", "/usr/share/pvc/plugins"
), ),
"dynamic_directory": o_path["dynamic_directory"], "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"], "console_log_directory": o_path["console_log_directory"],
"ceph_directory": o_path["ceph_directory"], "ceph_directory": o_path["ceph_directory"],
} }
@ -178,7 +178,7 @@ def get_configuration_current(config_file):
config_cluster = { config_cluster = {
"cluster_name": o_cluster["name"], "cluster_name": o_cluster["name"],
"all_nodes": o_cluster["all_nodes"], "all_nodes": o_cluster["all_nodes"],
"coordinators": o_cluster["all_coordinators"], "coordinators": o_cluster["coordinator_nodes"],
} }
config = {**config, **config_cluster} config = {**config, **config_cluster}
@ -193,20 +193,25 @@ def get_configuration_current(config_file):
"network_address" "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"][ f"{network_type}_floating_ip": o_cluster_networks_specific["ipv4"][
"floating_address" "floating_address"
] ]
+ "/" + "/"
+ o_cluster_networks_specific["ipv4"]["netmask"], + str(o_cluster_networks_specific["ipv4"]["netmask"]),
f"{network_type}_gateway": o_cluster_networks_specific["ipv4"][
"gateway_address"
],
f"{network_type}_node_ip_selection": o_cluster_networks_specific[ f"{network_type}_node_ip_selection": o_cluster_networks_specific[
"node_ip_selection" "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( result, msg = validate_floating_ip(
config_cluster_networks_specific, network_type config_cluster_networks_specific, network_type
) )
@ -217,7 +222,10 @@ def get_configuration_current(config_file):
config_cluster_networks_specific[f"{network_type}_network"] 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: with open(config["node_ip_file"], "r") as ipfh:
ip_last_octet = ipfh.read().strip() ip_last_octet = ipfh.read().strip()
address_id = [ address_id = [
@ -275,7 +283,7 @@ def get_configuration_current(config_file):
o_fencing = o_config["fencing"] o_fencing = o_config["fencing"]
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)), "fence_intervals": int(o_fencing["intervals"].get("fence_intervals", 6)),
"suicide_intervals": int(o_fencing["intervals"].get("suicide_interval", 0)), "suicide_intervals": int(o_fencing["intervals"].get("suicide_interval", 0)),
"successful_fence": o_fencing["actions"].get("successful_fence", None), "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() pvc_config_file, pvc_config_type = get_configuration_path()
if pvc_config_type == "legacy": if pvc_config_type == "legacy":
return get_configuration_legacy(pvc_config_file) config = get_configuration_legacy(pvc_config_file)
else: else:
return get_configuration_current(pvc_config_file) config = get_configuration_current(pvc_config_file)
return config
def validate_directories(config): def validate_directories(config):

View File

@ -205,7 +205,9 @@ timer:
# Fencing configuration # Fencing configuration
fencing: 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 disable_on_ipmi_failure: no
# Fencing intervals # Fencing intervals