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

Add a generic 'debug_level' attribute to opcodes



Also automatically fix opcodes which have this missing in the LU init
routine.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent adf385c7
...@@ -95,6 +95,10 @@ class LogicalUnit(object): ...@@ -95,6 +95,10 @@ class LogicalUnit(object):
self.LogStep = processor.LogStep # pylint: disable-msg=C0103 self.LogStep = processor.LogStep # pylint: disable-msg=C0103
# support for dry-run # support for dry-run
self.dry_run_result = None self.dry_run_result = None
# support for generic debug attribute
if (not hasattr(self.op, "debug_level") or
not isinstance(self.op.debug_level, int)):
self.op.debug_level = 0
# Tasklets # Tasklets
self.tasklets = None self.tasklets = None
......
...@@ -120,7 +120,7 @@ class OpCode(BaseOpCode): ...@@ -120,7 +120,7 @@ class OpCode(BaseOpCode):
""" """
OP_ID = "OP_ABSTRACT" OP_ID = "OP_ABSTRACT"
__slots__ = ["dry_run"] __slots__ = ["dry_run", "debug_level"]
def __getstate__(self): def __getstate__(self):
"""Specialized getstate for opcodes. """Specialized getstate for opcodes.
......
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