Revision a8b9a6e3 lib/config.py
b/lib/config.py | ||
---|---|---|
200 | 200 |
# better to raise an error before starting to modify the config |
201 | 201 |
# file than after it was modified |
202 | 202 |
self._my_hostname = netutils.Hostname.GetSysName() |
203 |
self._last_cluster_serial = -1 |
|
204 | 203 |
self._cfg_id = None |
205 | 204 |
self._context = None |
206 | 205 |
self._wconfd = None |
... | ... | |
2397 | 2396 |
raise errors.ConfigurationError(msg) |
2398 | 2397 |
|
2399 | 2398 |
self._config_data = data |
2400 |
# reset the last serial as -1 so that the next write will cause |
|
2401 |
# ssconf update |
|
2402 |
self._last_cluster_serial = -1 |
|
2403 | 2399 |
|
2404 | 2400 |
# Upgrade configuration if needed |
2405 | 2401 |
self._UpgradeConfig() |
... | ... | |
2509 | 2505 |
|
2510 | 2506 |
self.write_count += 1 |
2511 | 2507 |
|
2512 |
# Write ssconf files on all nodes (including locally) |
|
2513 |
if self._last_cluster_serial < self._config_data.cluster.serial_no: |
|
2514 |
if not self._offline: |
|
2515 |
result = self._GetRpc(None).call_write_ssconf_files( |
|
2516 |
self._UnlockedGetNodeNames(self._UnlockedGetOnlineNodeList()), |
|
2517 |
self._UnlockedGetSsconfValues()) |
|
2518 |
|
|
2519 |
for nname, nresu in result.items(): |
|
2520 |
msg = nresu.fail_msg |
|
2521 |
if msg: |
|
2522 |
errmsg = ("Error while uploading ssconf files to" |
|
2523 |
" node %s: %s" % (nname, msg)) |
|
2524 |
logging.warning(errmsg) |
|
2525 |
|
|
2526 |
if feedback_fn: |
|
2527 |
feedback_fn(errmsg) |
|
2528 |
|
|
2529 |
self._last_cluster_serial = self._config_data.cluster.serial_no |
|
2530 |
|
|
2531 | 2508 |
def _GetAllHvparamsStrings(self, hypervisors): |
2532 | 2509 |
"""Get the hvparams of all given hypervisors from the config. |
2533 | 2510 |
|
Also available in: Unified diff