diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 93d97cc5ba6ac5381bf101c701b901bb841f9592..c22427defb880e040a08b789265baebbbed91eb5 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -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