Commit 455a3445 authored by Iustin Pop's avatar Iustin Pop
Browse files

Only change instance status if not already so

This patch makes the _SetInstanceStatus only change the status of the
instance (in the config file) if it's not already in the desired state.
This skips the increase of the config serial no without actual data
changes.

Reviewed-by: ultrotter
parent 6a408fb2
...@@ -319,8 +319,9 @@ class ConfigWriter: ...@@ -319,8 +319,9 @@ class ConfigWriter:
raise errors.ConfigurationError("Unknown instance '%s'" % raise errors.ConfigurationError("Unknown instance '%s'" %
instance_name) instance_name)
instance = self._config_data.instances[instance_name] instance = self._config_data.instances[instance_name]
instance.status = status if instance.status != status:
self._WriteConfig() instance.status = status
self._WriteConfig()
def MarkInstanceUp(self, instance_name): def MarkInstanceUp(self, instance_name):
"""Mark the instance status to up in the config. """Mark the instance status to up in the config.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment