Logo Search packages:      
Sourcecode: ganeti version File versions  Download package

def lib::cmdlib::LogicalUnit::BuildHooksEnv (   self  ) 

Build hooks environment for this LU.

This method should return a three-node tuple consisting of: a dict
containing the environment that will be used for running the
specific hook for this LU, a list of node names on which the hook
should run before the execution, and a list of node names on which
the hook should run after the execution.

The keys of the dict must not have 'GANETI_' prefixed as this will
be handled in the hooks runner. Also note additional keys will be
added by the hooks runner. If the LU doesn't define any
environment, an empty dict (and not None) should be returned.

As for the node lists, the master should not be included in the
them, as it will be added by the hooks runner in case this LU
requires a cluster to run on (otherwise we don't have a node
list). No nodes should be returned as an empty list (and not
None).

Note that if the HPATH for a LU class is None, this function will
not be called.

Reimplemented in lib::cmdlib::NoHooksLU, lib::cmdlib::LUInitCluster, lib::cmdlib::LURenameCluster, lib::cmdlib::LURemoveNode, lib::cmdlib::LUAddNode, lib::cmdlib::LUMasterFailover, lib::cmdlib::LUStartupInstance, lib::cmdlib::LURebootInstance, lib::cmdlib::LUShutdownInstance, lib::cmdlib::LUReinstallInstance, lib::cmdlib::LURenameInstance, lib::cmdlib::LURemoveInstance, lib::cmdlib::LUFailoverInstance, lib::cmdlib::LUCreateInstance, lib::cmdlib::LUAddMDDRBDComponent, lib::cmdlib::LURemoveMDDRBDComponent, lib::cmdlib::LUReplaceDisks, lib::cmdlib::LUSetInstanceParms, and lib::cmdlib::LUExportInstance.

Definition at line 120 of file cmdlib.py.

00120                          :
    """Build hooks environment for this LU.

    This method should return a three-node tuple consisting of: a dict
    containing the environment that will be used for running the
    specific hook for this LU, a list of node names on which the hook
    should run before the execution, and a list of node names on which
    the hook should run after the execution.

    The keys of the dict must not have 'GANETI_' prefixed as this will
    be handled in the hooks runner. Also note additional keys will be
    added by the hooks runner. If the LU doesn't define any
    environment, an empty dict (and not None) should be returned.

    As for the node lists, the master should not be included in the
    them, as it will be added by the hooks runner in case this LU
    requires a cluster to run on (otherwise we don't have a node
    list). No nodes should be returned as an empty list (and not
    None).

    Note that if the HPATH for a LU class is None, this function will
    not be called.

    """
    raise NotImplementedError


class NoHooksLU(LogicalUnit):


Generated by  Doxygen 1.6.0   Back to index