Commit a3316e4a authored by Iustin Pop's avatar Iustin Pop
Browse files

Add the offline node list to ssconf

The patch also changes the various node list generation to be more
consistent.

Reviewed-by: imsnah
parent 56aa9fd5
......@@ -889,21 +889,24 @@ class ConfigWriter:
associated value
"""
node_list = utils.NiceSort(self._UnlockedGetNodeList())
mc_list = [self._UnlockedGetNodeInfo(name) for name in node_list]
mc_list = [node.name for node in mc_list if node.master_candidate]
node_list = "\n".join(node_list)
mc_list = "\n".join(mc_list)
fn = "\n".join
node_names = utils.NiceSort(self._UnlockedGetNodeList())
node_info = [self._UnlockedGetNodeInfo(name) for name in node_names]
off_data = fn(node.name for node in node_info if node.offline)
mc_data = fn(node.name for node in node_info if node.master_candidate)
node_data = fn(node_names)
cluster = self._config_data.cluster
return {
constants.SS_CLUSTER_NAME: cluster.cluster_name,
constants.SS_FILE_STORAGE_DIR: cluster.file_storage_dir,
constants.SS_MASTER_CANDIDATES: mc_list,
constants.SS_MASTER_CANDIDATES: mc_data,
constants.SS_MASTER_IP: cluster.master_ip,
constants.SS_MASTER_NETDEV: cluster.master_netdev,
constants.SS_MASTER_NODE: cluster.master_node,
constants.SS_NODE_LIST: node_list,
constants.SS_NODE_LIST: node_data,
constants.SS_OFFLINE_NODES: off_data,
}
@locking.ssynchronized(_config_lock)
......
......@@ -404,6 +404,7 @@ SS_MASTER_IP = "master_ip"
SS_MASTER_NETDEV = "master_netdev"
SS_MASTER_NODE = "master_node"
SS_NODE_LIST = "node_list"
SS_OFFLINE_NODES = "offline_nodes"
# cluster wide default parameters
DEFAULT_ENABLED_HYPERVISOR = HT_XEN_PVM
......
......@@ -132,6 +132,7 @@ class SimpleStore(object):
constants.SS_MASTER_NETDEV,
constants.SS_MASTER_NODE,
constants.SS_NODE_LIST,
constants.SS_OFFLINE_NODES,
)
_MAX_SIZE = 131072
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment