Revision f9780ccd
b/lib/config.py | ||
---|---|---|
1148 | 1148 |
instance_names = utils.NiceSort(self._UnlockedGetInstanceList()) |
1149 | 1149 |
node_names = utils.NiceSort(self._UnlockedGetNodeList()) |
1150 | 1150 |
node_info = [self._UnlockedGetNodeInfo(name) for name in node_names] |
1151 |
node_pri_ips = [ninfo.primary_ip for ninfo in node_info] |
|
1152 |
node_snd_ips = [ninfo.secondary_ip for ninfo in node_info] |
|
1151 | 1153 |
|
1152 | 1154 |
instance_data = fn(instance_names) |
1153 | 1155 |
off_data = fn(node.name for node in node_info if node.offline) |
1154 | 1156 |
on_data = fn(node.name for node in node_info if not node.offline) |
1155 | 1157 |
mc_data = fn(node.name for node in node_info if node.master_candidate) |
1156 | 1158 |
node_data = fn(node_names) |
1159 |
node_pri_ips_data = fn(node_pri_ips) |
|
1160 |
node_snd_ips_data = fn(node_snd_ips) |
|
1157 | 1161 |
|
1158 | 1162 |
cluster = self._config_data.cluster |
1159 | 1163 |
cluster_tags = fn(cluster.GetTags()) |
... | ... | |
1166 | 1170 |
constants.SS_MASTER_NETDEV: cluster.master_netdev, |
1167 | 1171 |
constants.SS_MASTER_NODE: cluster.master_node, |
1168 | 1172 |
constants.SS_NODE_LIST: node_data, |
1173 |
constants.SS_NODE_PRIMARY_IPS: node_pri_ips_data, |
|
1174 |
constants.SS_NODE_SECONDARY_IPS: node_snd_ips_data, |
|
1169 | 1175 |
constants.SS_OFFLINE_NODES: off_data, |
1170 | 1176 |
constants.SS_ONLINE_NODES: on_data, |
1171 | 1177 |
constants.SS_INSTANCE_LIST: instance_data, |
b/lib/constants.py | ||
---|---|---|
545 | 545 |
SS_MASTER_NETDEV = "master_netdev" |
546 | 546 |
SS_MASTER_NODE = "master_node" |
547 | 547 |
SS_NODE_LIST = "node_list" |
548 |
SS_NODE_PRIMARY_IPS = "node_primary_ips" |
|
549 |
SS_NODE_SECONDARY_IPS = "node_secondary_ips" |
|
548 | 550 |
SS_OFFLINE_NODES = "offline_nodes" |
549 | 551 |
SS_ONLINE_NODES = "online_nodes" |
550 | 552 |
SS_INSTANCE_LIST = "instance_list" |
b/lib/ssconf.py | ||
---|---|---|
101 | 101 |
constants.SS_MASTER_NETDEV, |
102 | 102 |
constants.SS_MASTER_NODE, |
103 | 103 |
constants.SS_NODE_LIST, |
104 |
constants.SS_NODE_PRIMARY_IPS, |
|
105 |
constants.SS_NODE_SECONDARY_IPS, |
|
104 | 106 |
constants.SS_OFFLINE_NODES, |
105 | 107 |
constants.SS_ONLINE_NODES, |
106 | 108 |
constants.SS_INSTANCE_LIST, |
... | ... | |
214 | 216 |
nl = data.splitlines(False) |
215 | 217 |
return nl |
216 | 218 |
|
219 |
def GetNodePrimaryIPList(self): |
|
220 |
"""Return the list of cluster nodes' primary IP. |
|
221 |
|
|
222 |
""" |
|
223 |
data = self._ReadFile(constants.SS_NODE_PRIMARY_IPS) |
|
224 |
nl = data.splitlines(False) |
|
225 |
return nl |
|
226 |
|
|
227 |
def GetNodeSecondaryIPList(self): |
|
228 |
"""Return the list of cluster nodes' secondary IP. |
|
229 |
|
|
230 |
""" |
|
231 |
data = self._ReadFile(constants.SS_NODE_SECONDARY_IPS) |
|
232 |
nl = data.splitlines(False) |
|
233 |
return nl |
|
234 |
|
|
217 | 235 |
def GetClusterTags(self): |
218 | 236 |
"""Return the cluster tags. |
219 | 237 |
|
Also available in: Unified diff