From 96d1a0c5e3350901ac59d06daef77764d88e457b Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Wed, 21 Apr 2010 16:07:40 +0200 Subject: [PATCH] LUSetClusterParams: initialize needed parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit β¦ since the opcode doesn't auto-initialize to None. Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Balazs Lecz <leczb@google.com> --- lib/cmdlib.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 66cd41631..ef3661734 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -2255,8 +2255,11 @@ class LUSetClusterParams(LogicalUnit): """Check parameters """ - if not hasattr(self.op, "candidate_pool_size"): - self.op.candidate_pool_size = None + for attr in ["candidate_pool_size", + "uid_pool", "add_uids", "remove_uids"]: + if not hasattr(self.op, attr): + setattr(self.op, attr, None) + if self.op.candidate_pool_size is not None: try: self.op.candidate_pool_size = int(self.op.candidate_pool_size) -- GitLab