Revision b2acdbdc lib/config.py
b/lib/config.py | ||
---|---|---|
164 | 164 |
self._my_hostname = netutils.Hostname.GetSysName() |
165 | 165 |
self._last_cluster_serial = -1 |
166 | 166 |
self._cfg_id = None |
167 |
self._context = None |
|
167 | 168 |
self._OpenConfig(accept_foreign) |
168 | 169 |
|
170 |
def _GetRpc(self, address_list): |
|
171 |
"""Returns RPC runner for configuration. |
|
172 |
|
|
173 |
""" |
|
174 |
return rpc.ConfigRunner(self._context, address_list) |
|
175 |
|
|
176 |
def SetContext(self, context): |
|
177 |
"""Sets Ganeti context. |
|
178 |
|
|
179 |
""" |
|
180 |
self._context = context |
|
181 |
|
|
169 | 182 |
# this method needs to be static, so that we can call it on the class |
170 | 183 |
@staticmethod |
171 | 184 |
def IsCluster(): |
... | ... | |
1749 | 1762 |
|
1750 | 1763 |
# TODO: Use dedicated resolver talking to config writer for name resolution |
1751 | 1764 |
result = \ |
1752 |
rpc.ConfigRunner(addr_list).call_upload_file(node_list, self._cfg_file)
|
|
1765 |
self._GetRpc(addr_list).call_upload_file(node_list, self._cfg_file)
|
|
1753 | 1766 |
for to_node, to_result in result.items(): |
1754 | 1767 |
msg = to_result.fail_msg |
1755 | 1768 |
if msg: |
... | ... | |
1808 | 1821 |
# Write ssconf files on all nodes (including locally) |
1809 | 1822 |
if self._last_cluster_serial < self._config_data.cluster.serial_no: |
1810 | 1823 |
if not self._offline: |
1811 |
result = rpc.ConfigRunner(None).call_write_ssconf_files(
|
|
1824 |
result = self._GetRpc(None).call_write_ssconf_files(
|
|
1812 | 1825 |
self._UnlockedGetOnlineNodeList(), |
1813 | 1826 |
self._UnlockedGetSsconfValues()) |
1814 | 1827 |
|
Also available in: Unified diff