Skip to content
Snippets Groups Projects
Commit b07a6922 authored by Guido Trotter's avatar Guido Trotter
Browse files

HooksMaster: Make RunPhase return the rpc output

Right now the hooks output is propagated from the nodes all the way up to
HooksMaster.RunPhase, which uses it for debugging PRE hooks, but then silently
discards them. We'll now propagate it up to the Processor.ExecOpCode function,
where they can be handled for other purposes (or discarded again, of course).
This patch also improves a bit the HooksMaster.RunPhase docstring.

Reviewed-by: iustinp
parent 10cd4a29
No related branches found
No related tags found
No related merge requests found
...@@ -264,6 +264,12 @@ class HooksMaster(object): ...@@ -264,6 +264,12 @@ class HooksMaster(object):
This is the main function of the HookMaster. This is the main function of the HookMaster.
Args:
phase: the hooks phase to run
Returns:
the result of the hooks multi-node rpc call
""" """
if not self.node_list[phase]: if not self.node_list[phase]:
# empty node list, we should not attempt to run this as either # empty node list, we should not attempt to run this as either
...@@ -287,6 +293,7 @@ class HooksMaster(object): ...@@ -287,6 +293,7 @@ class HooksMaster(object):
errs.append((node_name, script, output)) errs.append((node_name, script, output))
if errs: if errs:
raise errors.HooksAbort(errs) raise errors.HooksAbort(errs)
return results
def RunConfigUpdate(self): def RunConfigUpdate(self):
"""Run the special configuration update hook """Run the special configuration update hook
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment