Revision f34901f8 lib/config.py
b/lib/config.py | ||
---|---|---|
954 | 954 |
if self._config_data is None: |
955 | 955 |
raise errors.ProgrammerError("Configuration file not read," |
956 | 956 |
" cannot save.") |
957 |
update_serial = True
|
|
957 |
update_serial = False
|
|
958 | 958 |
if isinstance(target, objects.Cluster): |
959 | 959 |
test = target == self._config_data.cluster |
960 | 960 |
elif isinstance(target, objects.Node): |
961 | 961 |
test = target in self._config_data.nodes.values() |
962 |
update_serial = True |
|
962 | 963 |
elif isinstance(target, objects.Instance): |
963 | 964 |
test = target in self._config_data.instances.values() |
964 |
update_serial = False |
|
965 | 965 |
else: |
966 | 966 |
raise errors.ProgrammerError("Invalid object type (%s) passed to" |
967 | 967 |
" ConfigWriter.Update" % type(target)) |
968 | 968 |
if not test: |
969 | 969 |
raise errors.ConfigurationError("Configuration updated since object" |
970 | 970 |
" has been read or unknown object") |
971 |
target.serial_no += 1 |
|
972 |
|
|
971 | 973 |
if update_serial: |
972 |
target.serial_no += 1 |
|
974 |
# for node updates, we need to increase the cluster serial too |
|
975 |
self._config_data.cluster.serial_no += 1 |
|
973 | 976 |
|
974 | 977 |
self._WriteConfig() |
Also available in: Unified diff