Revision efbb4fd2 lib/ssconf.py
b/lib/ssconf.py | ||
---|---|---|
106 | 106 |
if 'ip' in nic and nic['ip']: |
107 | 107 |
self._ip_to_instance[nic['ip']] = iname |
108 | 108 |
|
109 |
self._nodes_primary_ips = [] |
|
110 |
self._mc_primary_ips = [] |
|
111 |
for node_name in self._config_data["nodes"]: |
|
112 |
node = self._config_data["nodes"][node_name] |
|
113 |
self._nodes_primary_ips.append(node["primary_ip"]) |
|
114 |
if node["master_candidate"]: |
|
115 |
self._mc_primary_ips.append(node["primary_ip"]) |
|
116 |
|
|
109 | 117 |
return True |
110 | 118 |
|
111 | 119 |
# Clients can request a reload of the config file, so we export our internal |
... | ... | |
187 | 195 |
return None |
188 | 196 |
return self._config_data["instances"][instance]["primary_node"] |
189 | 197 |
|
198 |
def GetNodesPrimaryIps(self): |
|
199 |
return self._nodes_primary_ips |
|
200 |
|
|
201 |
def GetMasterCandidatesPrimaryIps(self): |
|
202 |
return self._mc_primary_ips |
|
203 |
|
|
190 | 204 |
|
191 | 205 |
class SimpleStore(object): |
192 | 206 |
"""Interface to static cluster data. |
Also available in: Unified diff