Commit df4272e5 authored by Iustin Pop's avatar Iustin Pop
Browse files

LUCreateInstance: Move parameter init earlier



This way, the parameters are available in CheckArguments too.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent d8aee57e
......@@ -5785,6 +5785,11 @@ class LUCreateInstance(LogicalUnit):
"""Check arguments.
"""
# set optional parameters to none if they don't exist
for attr in ["pnode", "snode", "iallocator", "hypervisor"]:
if not hasattr(self.op, attr):
setattr(self.op, attr, None)
# do not require name_check to ease forward/backward compatibility
# for tools
if not hasattr(self.op, "name_check"):
......@@ -5808,11 +5813,6 @@ class LUCreateInstance(LogicalUnit):
"""
self.needed_locks = {}
# set optional parameters to none if they don't exist
for attr in ["pnode", "snode", "iallocator", "hypervisor"]:
if not hasattr(self.op, attr):
setattr(self.op, attr, None)
# cheap checks, mostly valid constants given
# verify creation mode
......
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