From bde8f48176e9f85139c8731ee0de61964346e2ed Mon Sep 17 00:00:00 2001 From: Adeodato Simo <dato@google.com> Date: Thu, 2 Dec 2010 13:03:47 +0000 Subject: [PATCH] opcodes: document OP_DSC_FIELD in OpCode and OpCode.Summary() Signed-off-by: Adeodato Simo <dato@google.com> Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: Michael Hanselmann <hansmi@google.com> --- lib/opcodes.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/opcodes.py b/lib/opcodes.py index 931382808..d119f45a1 100644 --- a/lib/opcodes.py +++ b/lib/opcodes.py @@ -115,6 +115,9 @@ class OpCode(BaseOpCode): @cvar OP_ID: The ID of this opcode. This should be unique amongst all children of this class. + @cvar OP_DSC_FIELD: The name of a field whose value will be included in the + string returned by Summary(); see the docstring of that + method for details). @ivar dry_run: Whether the LU should be run in dry-run mode, i.e. just the check steps @ivar priority: Opcode priority for queue @@ -170,6 +173,11 @@ class OpCode(BaseOpCode): def Summary(self): """Generates a summary description of this opcode. + The summary is the value of the OP_ID attribute (without the "OP_" prefix), + plus the value of the OP_DSC_FIELD attribute, if one was defined; this field + should allow to easily identify the operation (for an instance creation job, + e.g., it would be the instance name). + """ # all OP_ID start with OP_, we remove that txt = self.OP_ID[3:] -- GitLab