« Previous | Next » 

Revision dd7f6776

Parent ebc75510
Child 0dfa2c22

Added by Michael Hanselmann over 13 years ago

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,
but that's not a generic solution.

This patch modifies the code calling hooks to generate the environment
once before and once after an opcode has been executed. Doing so should
be safe—I did not find any LU.BuildHooksEnv modifying LU instance
attributes. The values collected after running the opcode are prefixed
with “GANETI_POST_”, as opposed to “GANETI_” for pre-execution
variables. The latter are still provided for backwards compatibility.

Environment variable examples:

gnt-instance start $instance:

gnt-instance modify -B memory=512 $instance:

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


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences