Commit 97abc79f authored by Iustin Pop's avatar Iustin Pop
Browse files

Replace a cfg.AddInstance with UpdateInstance

This seems to be the last (deprecated) use of AddInstance in order to
update an instance.

The patch also removes a whitespace-at-eol case.

Reviewed-by: ultrotter
parent fbd6f863
...@@ -2373,7 +2373,7 @@ class LUReinstallInstance(LogicalUnit): ...@@ -2373,7 +2373,7 @@ class LUReinstallInstance(LogicalUnit):
if self.op.os_type is not None: if self.op.os_type is not None:
feedback_fn("Changing OS to '%s'..." % self.op.os_type) feedback_fn("Changing OS to '%s'..." % self.op.os_type)
inst.os = self.op.os_type inst.os = self.op.os_type
self.cfg.AddInstance(inst) self.cfg.Update(inst)
_StartInstanceDisks(self.cfg, inst, None) _StartInstanceDisks(self.cfg, inst, None)
try: try:
...@@ -3257,7 +3257,7 @@ class LUCreateInstance(LogicalUnit): ...@@ -3257,7 +3257,7 @@ class LUCreateInstance(LogicalUnit):
if len(ial.nodes) != ial.required_nodes: if len(ial.nodes) != ial.required_nodes:
raise errors.OpPrereqError("iallocator '%s' returned invalid number" raise errors.OpPrereqError("iallocator '%s' returned invalid number"
" of nodes (%s), required %s" % " of nodes (%s), required %s" %
(self.op.iallocator, len(ial.nodes), (self.op.iallocator, len(ial.nodes),
ial.required_nodes)) ial.required_nodes))
self.op.pnode = ial.nodes[0] self.op.pnode = ial.nodes[0]
logger.ToStdout("Selected nodes for the instance: %s" % logger.ToStdout("Selected nodes for the instance: %s" %
......
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