Skip to content
Snippets Groups Projects
Commit 9bc5ac44 authored by René Nussbaumer's avatar René Nussbaumer
Browse files

Provide a custom Validate for OpInstanceMultiAlloc


This is needed, as we're not strictly separating validation from
populating the defaults. We do this all in one function. If we now
receive a non complete OpInstanceCreate opcode in instances, we would
run into AttributeErrors on those.

So we run the validation + recursively on all instances opcodes.

Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 2958c56e
No related branches found
No related tags found
No related merge requests found
......@@ -1256,6 +1256,17 @@ class OpInstanceMultiAlloc(OpCode):
state["instances"] = insts
return OpCode.__setstate__(self, state)
def Validate(self, set_defaults):
"""Validates this opcode.
We do this recursively.
"""
OpCode.Validate(self, set_defaults)
for inst in self.instances:
inst.Validate(set_defaults)
class OpInstanceReinstall(OpCode):
"""Reinstall an instance's OS."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment