From 0e46916d48b44b3cf51feb56763b63109f34d7be Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Tue, 15 Jul 2008 11:56:18 +0000
Subject: [PATCH] Rename BaseJO to BaseOpCode

Since we don't have for now a job definition object anymore, we rename
this class to BaseOpCode. It's still useful (and not merged with OpCode)
since it holds all the 'pure' logic (no custom field handling, etc.)
whereas OpCode holds opcode specific data (OP_ID handling, etc).

The patch also fixes the module's docstring.

Reviewed-by: imsnah
---
 lib/opcodes.py | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/lib/opcodes.py b/lib/opcodes.py
index 0c8ad185f..d19dc0528 100644
--- a/lib/opcodes.py
+++ b/lib/opcodes.py
@@ -24,11 +24,8 @@
 This module implements the data structures which define the cluster
 operations - the so-called opcodes.
 
-
-This module implements the logic for doing operations in the cluster. There
-are two kinds of classes defined:
-  - opcodes, which are small classes only holding data for the task at hand
-  - logical units, which know how to deal with their specific opcode only
+Every operation which modifies the cluster state is expressed via
+opcodes.
 
 """
 
@@ -37,11 +34,12 @@ are two kinds of classes defined:
 # pylint: disable-msg=R0903
 
 
-class BaseJO(object):
+class BaseOpCode(object):
   """A simple serializable object.
 
-  This object serves as a parent class for both OpCode and Job since
-  they are serialized in the same way.
+  This object serves as a parent class for OpCode without any custom
+  field handling.
+
 
   """
   __slots__ = []
@@ -73,7 +71,7 @@ class BaseJO(object):
       setattr(self, name, state[name])
 
 
-class OpCode(BaseJO):
+class OpCode(BaseOpCode):
   """Abstract OpCode"""
   OP_ID = "OP_ABSTRACT"
   __slots__ = []
@@ -82,7 +80,7 @@ class OpCode(BaseJO):
     """Specialized getstate for opcodes.
 
     """
-    data = BaseJO.__getstate__(self)
+    data = BaseOpCode.__getstate__(self)
     data["OP_ID"] = self.OP_ID
     return data
 
-- 
GitLab