commit b9f723c34d53a810834b0542e90efc96699b91bb
Merge: 643c66b 5d93952
Author: Klaus Aehlig <[email protected]>
Date:   Thu Jan 21 13:53:36 2016 +0100

    Merge branch 'stable-2.17' into master
    
    * stable-2.17
      Clean up after failed node-add-pre hooks
      Light-weight SSH key removal
      Introduce HooksAbortCallBack
      Add useful hints to hooks documentation
      Introduce backoff to RetryByNumberOfTimes
      Unit tests for RetryByNumberOfTimes
      Disable file-logging for tools on ext. nodes
      Update documentation of gnt-node {add,remove,modify}
      Propagate --debug/verbose in gnt-node add/remove/modify
      Catch IOError of SSH files when removing node
      Fix renew-crypto on one-node-cluster
      Update documentation of renew-crypto
      Increase loglevel of renew-crypto after upgrades
      Expose verbose/debug option to renew-crypto
      ssh_update: log data that is received
      Make all tools log with their name
      Propagate verbose/debug option to ssh_update calls
      Make SetupToolsLogging use tools logfile
    
    * stable-2.16
      Document the increased timeout as an incompatible change
      Increase timeouts for luxi by a factor of 3
      Do not repeat constants in comments
      Send messages as Strings
    
    * stable-2.15
      Catch IOError of SSH files when removing node
      Fix renew-crypto on one-node-cluster
      ssh_update: log data that is received
      Increase timeout of RPC adding/removing keys
      After TestNodeModify, fix the pool of master candidates
    
    * stable-2.14
      Test disk attachment with different primary nodes
      Check for same primary node before disk attachment
      Add detach/attach sequence test
      Allow disk attachment with external storage
    
    * stable-2.13
      Run ssh-key renewal in debug mode during upgrade
    
    * stable-2.12
      Increase minimal sizes of test online nodes
      Also log the high-level upgrade steps
      Add function to provide logged user feedback
      Run renew-crypto in upgrades in debug mode
      Unconditionally log upgrades at debug level
      Document healthy-majority restriction on master-failover
      Check for healthy majority on master failover with voting
      Add a predicate testing that a majority of nodes is healthy
      Fix outdated comment
      Pass arguments to correct daemons during master-failover
      Fix documentation for master-failover
    
    * stable-2.11
      (no changes)
    
    * stable-2.10
      KVM: explicitly configure routed NICs late
    
    Conflicts:
        doc/hooks.rst: take both additions
        lib/mcpu.py: run all hooks in an environment
          with HooksAbortCallBack
    
    Signed-off-by: Klaus Aehlig <[email protected]>

diff --cc doc/hooks.rst
index bf3fc67,667906b..6d2b071
--- a/doc/hooks.rst
+++ b/doc/hooks.rst
@@@ -17,8 -18,10 +18,12 @@@ are named ``$hook-$phase.d``, where ``$
  This is similar to the ``/etc/network/`` structure present in Debian
  for network interface handling.
  
+ Note that Ganeti does not create its ``hooks`` directory by default.
+ If you want to use hooks scripts, create it on all nodes. This applies
+ also to all sub directories such as ``node-add-pre.d``.
+ 
 +.. _hooks-organization:
 +
  Organisation
  ------------
  
diff --cc lib/mcpu.py
index 4ef1bd5,b3d4966..6eb70a7
--- a/lib/mcpu.py
+++ b/lib/mcpu.py
@@@ -484,10 -483,17 +484,19 @@@ class Processor(object)
      lu.cfg.OutDate()
      lu.CheckPrereq()
  
 -    hm = self.BuildHooksManager(lu)
 +    self._hm = self.BuildHooksManager(lu)
-     # Run hooks twice: first for the global hooks, then for the usual hooks.
-     self._hm.RunPhase(constants.HOOKS_PHASE_PRE, is_global=True)
-     h_results = self._hm.RunPhase(constants.HOOKS_PHASE_PRE)
+     try:
 -      h_results = hm.RunPhase(constants.HOOKS_PHASE_PRE)
++      # Run hooks twice: first for the global hooks, then for the usual hooks.
++      self._hm.RunPhase(constants.HOOKS_PHASE_PRE, is_global=True)
++      h_results = self._hm.RunPhase(constants.HOOKS_PHASE_PRE)
+     except Exception, err:  # pylint: disable=W0703
+       # This gives the LU a chance of cleaning up in case of an hooks failure.
+       # The type of exception is deliberately broad to be able to react to
+       # any kind of failure.
+       lu.HooksAbortCallBack(constants.HOOKS_PHASE_PRE, self.Log, err)
+       # We re-raise the exception to not alter the behavior of LU handling
+       # otherwise.
+       raise err
      lu.HooksCallBack(constants.HOOKS_PHASE_PRE, h_results,
                       self.Log, None)
  

-- 
Klaus Aehlig
Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschaeftsfuehrer: Matthew Scott Sucherman, Paul Terence Manicle

Reply via email to