Module opcodes_base
source code
OpCodes base module
This module implements part of the data structures which define the
cluster operations - the so-called opcodes.
Every operation which modifies the cluster state is expressed via
opcodes.
array of strings
|
|
string
|
|
string
|
|
callable
|
|
|
_OPID_RE = re.compile("([a-z])([A-Z])")
OP_ID conversion regular expression
|
|
SUMMARY_PREFIX = {"CLUSTER_": "C_", "GROUP_": "G_", "NODE_": "...
|
|
DEPEND_ATTR = "depends"
Attribute name for dependencies
|
|
COMMENT_ATTR = "comment"
Attribute name for comment
|
|
TNoRelativeJobDependencies = BuildJobDepCheck(False)
|
Imports:
copy,
logging,
re,
constants,
errors,
ht,
outils
Split an opcode class name into its components
- Parameters:
name (string) - the class name, as OpXxxYyy
- Returns: array of strings
- the components of the name
|
Convert an opcode class name to an OP_ID.
- Parameters:
name (string) - the class name, as OpXxxYyy
- Returns: string
- the name in the OP_XXXX_YYYY format
|
Convert an opcode class name to a source string for the reason
trail
- Parameters:
name (string) - the class name, as OpXxxYyy
- Returns: string
- the name in the OP_XXXX_YYYY format
|
Builds check for job dependencies (DEPEND_ATTR).
- Parameters:
relative (bool) - Whether to accept relative job IDs (negative)
- Returns: callable
|
SUMMARY_PREFIX
- Value:
{"CLUSTER_": "C_", "GROUP_": "G_", "NODE_": "N_", "INSTANCE_": "I_",}
|
|