Commit 5c54b832 authored by Iustin Pop's avatar Iustin Pop
Browse files

LURemoveInstance: fix op.ignore_failures usage

Currently: the LURemoveInstance.Exec() method uses the ignore_failures
attribute of the OpRemoveInstance opcode, but it doesn't check for its
existence. The patch adds this attribute to _OP_REQP and to all the
places where this opcode was created.

This attributes is always passed by gnt-instance, but burnin didn't pass
it so it can fail if it enters the 'fail to remove disks' branch of the
method (which is why it was not triggered until now).

Reviewed-by: ultrotter, imsnah
parent bd028152
......@@ -2662,7 +2662,7 @@ class LURemoveInstance(LogicalUnit):
HPATH = "instance-remove"
_OP_REQP = ["instance_name"]
_OP_REQP = ["instance_name", "ignore_failures"]
def BuildHooksEnv(self):
"""Build hooks env.
......@@ -291,7 +291,8 @@ class Burner(object):
exp_op = opcodes.OpExportInstance(instance_name=instance,
rem_op = opcodes.OpRemoveInstance(instance_name=instance)
rem_op = opcodes.OpRemoveInstance(instance_name=instance,
nam_op = opcodes.OpQueryInstances(output_fields=["name"],
full_name = self.ExecOp(nam_op)[0][0]
......@@ -356,7 +357,8 @@ class Burner(object):
def Remove(self):
"""Remove the instances."""
for instance in self.to_rem:
op = opcodes.OpRemoveInstance(instance_name=instance)
op = opcodes.OpRemoveInstance(instance_name=instance,
Log("- Remove instance %s" % instance)
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