Revision a3316e4a lib/config.py
b/lib/config.py | ||
---|---|---|
889 | 889 |
associated value |
890 | 890 |
|
891 | 891 |
""" |
892 |
node_list = utils.NiceSort(self._UnlockedGetNodeList()) |
|
893 |
mc_list = [self._UnlockedGetNodeInfo(name) for name in node_list] |
|
894 |
mc_list = [node.name for node in mc_list if node.master_candidate] |
|
895 |
node_list = "\n".join(node_list) |
|
896 |
mc_list = "\n".join(mc_list) |
|
892 |
fn = "\n".join |
|
893 |
node_names = utils.NiceSort(self._UnlockedGetNodeList()) |
|
894 |
node_info = [self._UnlockedGetNodeInfo(name) for name in node_names] |
|
895 |
|
|
896 |
off_data = fn(node.name for node in node_info if node.offline) |
|
897 |
mc_data = fn(node.name for node in node_info if node.master_candidate) |
|
898 |
node_data = fn(node_names) |
|
897 | 899 |
|
898 | 900 |
cluster = self._config_data.cluster |
899 | 901 |
return { |
900 | 902 |
constants.SS_CLUSTER_NAME: cluster.cluster_name, |
901 | 903 |
constants.SS_FILE_STORAGE_DIR: cluster.file_storage_dir, |
902 |
constants.SS_MASTER_CANDIDATES: mc_list,
|
|
904 |
constants.SS_MASTER_CANDIDATES: mc_data,
|
|
903 | 905 |
constants.SS_MASTER_IP: cluster.master_ip, |
904 | 906 |
constants.SS_MASTER_NETDEV: cluster.master_netdev, |
905 | 907 |
constants.SS_MASTER_NODE: cluster.master_node, |
906 |
constants.SS_NODE_LIST: node_list, |
|
908 |
constants.SS_NODE_LIST: node_data, |
|
909 |
constants.SS_OFFLINE_NODES: off_data, |
|
907 | 910 |
} |
908 | 911 |
|
909 | 912 |
@locking.ssynchronized(_config_lock) |
Also available in: Unified diff