From 7c0709611574a1e54ec69f160d189c7d20597aa2 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Tue, 2 Aug 2011 15:01:34 +0200 Subject: [PATCH] Fix types passed to IAllocator Iallocator mode reloc, parameter reloc_from takes a list; half of the code already forced this parameter to list, we add the other two cases where it is needed. Signed-off-by: Iustin Pop Reviewed-by: Michael Hanselmann --- lib/cmdlib.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 9955e4c..703992d 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -9196,7 +9196,7 @@ class TLReplaceDisks(Tasklet): ial = IAllocator(lu.cfg, lu.rpc, mode=constants.IALLOCATOR_MODE_RELOC, name=instance_name, - relocate_from=relocate_from) + relocate_from=list(relocate_from)) ial.Run(iallocator_name) @@ -13133,7 +13133,8 @@ class LUTestAllocator(NoHooksLU): elif self.op.mode == constants.IALLOCATOR_MODE_RELOC: fname = _ExpandInstanceName(self.cfg, self.op.name) self.op.name = fname - self.relocate_from = self.cfg.GetInstanceInfo(fname).secondary_nodes + self.relocate_from = \ + list(self.cfg.GetInstanceInfo(fname).secondary_nodes) elif self.op.mode == constants.IALLOCATOR_MODE_MEVAC: if not hasattr(self.op, "evac_nodes"): raise errors.OpPrereqError("Missing attribute 'evac_nodes' on" -- 1.7.10.4