class documentation

class HooksRunner(object):

View In Hierarchy

Hook runner.

This class is instantiated on the node side (ganeti-noded) and not on the master side.

Method __init__ Constructor for hooks runner.
Method RunHooks Run the scripts in the hooks directory.
Method RunLocalHooks Check that the hooks will be run only locally and then run them.
Instance Variable _BASE_DIR Undocumented
def __init__(self, hooks_base_dir=None):

Constructor for hooks runner.

Parameters
hooks_base_dir:str or Noneif not None, this overrides the pathutils.HOOKS_BASE_DIR (useful for unittests)
def RunHooks(self, hpath, phase, env):

Run the scripts in the hooks directory.

Parameters
hpath:strthe path to the hooks directory which holds the scripts
phase:streither constants.HOOKS_PHASE_PRE or constants.HOOKS_PHASE_POST
env:dictdictionary with the environment for the hook
Returns
list

list of 3-element tuples:

Raises
errors.ProgrammerErrorfor invalid input parameters
def RunLocalHooks(self, node_list, hpath, phase, env):

Check that the hooks will be run only locally and then run them.

_BASE_DIR =

Undocumented