Package ganeti :: Module mcpu :: Class HooksMaster
[hide private]
[frames] | no frames]

Class HooksMaster

source code


Hooks master.

This class distributes the run commands to the nodes based on the specific LU class.

In order to remove the direct dependency on the rpc module, the constructor needs a function which actually does the remote call. This will usually be rpc.call_hooks_runner, but any function which behaves the same works.

Instance Methods [hide private]
 
__init__(self, callfn, lu)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_BuildEnv(self, phase)
Compute the environment and the target nodes.
source code
 
_RunWrapper(self, node_list, hpath, phase, phase_env)
Simple wrapper over self.callfn.
source code
 
RunPhase(self, phase, nodes=None)
Run all the scripts for a phase.
source code
 
RunConfigUpdate(self)
Run the special configuration update hook
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, callfn, lu)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

_BuildEnv(self, phase)

source code 

Compute the environment and the target nodes.

Based on the opcode and the current node list, this builds the environment for the hooks and the target node list for the run.

_RunWrapper(self, node_list, hpath, phase, phase_env)

source code 

Simple wrapper over self.callfn.

This method fixes the environment before doing the rpc call.

RunPhase(self, phase, nodes=None)

source code 

Run all the scripts for a phase.

This is the main function of the HookMaster.

Parameters:
Returns:
the processed results of the hooks multi-node rpc call
Raises:

RunConfigUpdate(self)

source code 

Run the special configuration update hook

This is a special hook that runs only on the master after each top-level LI if the configuration has been updated.