Statistics
| Branch: | Tag: | Revision:

root / test / ganeti.hooks_unittest.py @ 30f2802f

History | View | Annotate | Download (17.1 kB)

# Date Author Comment
949dcb1d 11/01/2011 08:37 pm Andrea Spadaccini

Generalize HooksMaster

- remove any dependence on Logical Units from the HooksMaster;
- add a new function parameter to the constructor, a function that is
expected to convert the results of the hooks execution in a format
understood by the HooksMaster;...

3fc210de 10/27/2011 12:31 pm Andrea Spadaccini

Fix parameters of RpcResult in hooks unit tests

In FakeHooksRpcSuccess, the data parameter of the RpcResult constructor
was not enclosed in a tuple. While this does not make the test fail, it
must be fixed.

Signed-off-by: Andrea Spadaccini <>...

07e0896f 03/18/2011 04:53 pm Michael Hanselmann

Split BuildHooksEnv of LUs

Commit dd7f677623 added another call to BuildHooksEnv to provide
post-phase status variables. Since BuildHooksEnv also built the node
lists, that meant they have to be built twice. First a rather strict
check was used, but it turned out to be more tricky. Commit b423c51336...

b423c513 03/17/2011 06:43 pm Michael Hanselmann

Remove restrictive hook node list check

Commit dd7f67762 added a restrictive check for the node lists returned
by BuildHooksEnv, leading to errors with some LUs, one of which was
fixed in commit 0dfa2c227. As it turns out, other LUs have similar
issues, some not easy to fix. This patch disables the restrictive check...

dd7f6776 03/16/2011 07:58 pm Michael Hanselmann

hooks: Provide variables with post-opcode values

When a hook is called, it is provided with a number of variables
describing the status of the instance/node/etc. before the operation.
Some opcodes provide extra variables to see modified values from hooks,...

25231ec5 11/03/2009 12:34 pm Michael Hanselmann

Ignore log messages in unittests

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

4b5e8271 08/24/2009 03:11 pm Iustin Pop

Remove extra argument from HooksMaster class

The mcpu.py:HooksMaster class needs to have a proc attribute/argument to
init in ordet to call its LogWarning method. However, this is available
from the 'lu' attribute, so we can remove this dependency.

Signed-off-by: Iustin Pop <>...

d019f8bd 06/15/2009 08:30 pm Iustin Pop

Fix hooks unittests after RPC result changes

Patch "Simplify the RPC result framework in backend.py" changed all
RPCs, and thus the hooks results where also changed. This needs changes
to the hooks unittests too.

Signed-off-by: Iustin Pop <>...

3fb4f740 06/15/2009 08:08 pm Iustin Pop

Convert hooks_runner rpc to new style result

This also converts (and fixes) unittests and mock objects to deal with
this change, and the custom hook verifier in cmdlib.LUClusterVerify.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

7b80424f 02/03/2009 05:42 pm Iustin Pop

Fix unittest encoding breakage

Due to the fact that we sanitize now the output from environment
scripts, the unittest needs to be adjusted. My bad for not checking it.

Reviewed-by: imsnah

7ccb3074 12/02/2008 04:49 pm Guido Trotter

Fix hooks_unittest with new rpc call structure

Reviewed-by: iustinp

86d9d3bb 10/21/2008 08:54 pm Iustin Pop

Move some LU logging to use proc.Log*

We change some messages which are obviously intended for the user to use
the proc.Log* functions instead of (only) the logging ones.

We also fix some wrong uses of feedback_fn.

Reviewed-by: imsnah

72737a7f 10/10/2008 12:55 pm Iustin Pop

Convert rpc module to RpcRunner

This big patch changes the call model used in internode-rpc from
standalong function calls in the rpc module to via a RpcRunner class,
that holds all the methods. This can be used in the future to enable
smarter processing in the RPC layer itself (some quick examples are not...

c259ce64 10/01/2008 08:37 pm Michael Hanselmann

Get rid of ssconf

Remove leftovers from ssconf.

Reviewed-by: iustinp

77b657a3 07/08/2008 11:49 am Guido Trotter

Pass context to LUs

Rather than passing a ConfigWriter to the LUs we'll pass the whole
context, from which a ConfigWriter can be extracted, but we can also
access the GanetiLockManager. This also fixes the places where a FakeLU
is created.

Reviewed-by: iustinp

d2525573 06/30/2008 07:11 pm Guido Trotter

Remove duplicate code in hooks unittests

All the tests there used to creare a cfg, a sstore, an opcode and a LU.
Put all the duplicate code in the setUp function.

Reviewed-by: iustinp

2395c322 11/09/2007 10:13 pm Iustin Pop

Soften the requirements for hooks execution

Currently, an unreachable node (or one that return undetermined failure)
in the hooks pre-phase will abort the curren operation. This is not
good, as a down node could prevent many operation on the cluster.

This patch changes a RPC-level failure (and not a hook execution...

fafa5990 10/17/2007 05:36 pm Alexander Schreiber

Fix unit tests for hooks.

Reviewed-by: imsnah

5ca84bdd 09/12/2007 06:54 pm Michael Hanselmann

Fix typo in last commit.