__init__(self,
opcode,
hooks_path,
nodes,
hooks_execution_fn,
hooks_results_adapt_fn,
build_env_fn,
prepare_post_nodes_fn,
log_fn,
htype=None,
cluster_name=None,
master_name=None)
(Constructor)
| source code
|
Base class for hooks masters.
This class invokes the execution of hooks according to the behaviour
specified by its parameters.
- Parameters:
opcode (string) - opcode of the operation to which the hooks are tied
hooks_path (string) - prefix of the hooks directories
nodes (2-tuple of lists) - 2-tuple of lists containing nodes on which pre-hooks must be run
and nodes on which post-hooks must be run
hooks_execution_fn (function that accepts the following parameters: (node_list,
hooks_path, phase, environment)) - function that will execute the hooks; can be None, indicating
that no conversion is necessary.
hooks_results_adapt_fn (function) - function that will adapt the return value of hooks_execution_fn
to the format expected by RunPhase
build_env_fn (function that returns a dictionary having strings as keys) - function that builds the environment for the hooks
prepare_post_nodes_fn (function that take a list of node UUIDs and returns a list of
node UUIDs) - function that is invoked right before executing post hooks and
can change the list of node UUIDs to run the post hooks on
log_fn (function that accepts a string) - logging function
htype (string or None) - None or one of constants.HTYPE_CLUSTER, constants.HTYPE_NODE,
constants.HTYPE_INSTANCE
cluster_name (string) - name of the cluster
master_name (string) - name of the master
- Overrides:
object.__init__
|