Package ganeti :: Module opcodes :: Class OpCode
[hide private]
[frames] | no frames]

Class OpCode

source code


Abstract OpCode.

This is the root of the actual OpCode hierarchy. All clases derived from this class should override OP_ID.

Instance Methods [hide private]
dict
__getstate__(self)
Specialized getstate for opcodes.
source code
 
Summary(self)
Generates a summary description of this opcode.
source code

Inherited from BaseOpCode: __init__, __setstate__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
LoadOpCode(cls, data)
Generic load opcode method.
source code

Inherited from BaseOpCode (private): _all_slots

Class Variables [hide private]
  OP_ID = "OP_ABSTRACT"
The ID of this opcode.
Instance Variables [hide private]
  dry_run
Whether the LU should be run in dry-run mode, i.e.
  priority
Opcode priority for queue
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__getstate__(self)

source code 

Specialized getstate for opcodes.

This method adds to the state dictionary the OP_ID of the class, so that on unload we can identify the correct class for instantiating the opcode.

Returns: dict
the state as a dictionary
Overrides: BaseOpCode.__getstate__

LoadOpCode(cls, data)
Class Method

source code 

Generic load opcode method.

The method identifies the correct opcode class from the dict-form by looking for a OP_ID key, if this is not found, or its value is not available in this module as a child of this class, we fail.

Parameters:
  • data (dict) - the serialized opcode

Class Variable Details [hide private]

OP_ID

The ID of this opcode. This should be unique amongst all children of this class.
Value:
"OP_ABSTRACT"

Instance Variable Details [hide private]

dry_run

Whether the LU should be run in dry-run mode, i.e. just the check steps