I think that's not needed. The return value of the method (lu_result) is
correctly updated if there are results from nodes. The case which happened
in issue 742 was that an offline node was incorrectly contacted. However,
the result of this attempt didn't make it in the return value of
HooksCallBack(...), because in line 3252 the result of offline nodes is
discarded. So while fixing issue 742, this instances of the bug should go
away.

However, the result of the node is also discarded if it gave an error
message (also checked in line 3252). This sounds fishy to me, as the return
value should be False as well if the RPC call resulted in an error... So
maybe something like this would make more sense:

if test:    # test is defined in line 3249
  lu_result = False
  continue
if res.offline:
  continue

What do you think?

Cheers,
Thomas


On Mon, Mar 3, 2014 at 6:42 PM, Michele Tartara <[email protected]> wrote:

> An error in the post-commit hooks could not be propagated correctly and
> could
> result in e.g. the return code of gnt-cluster verify to be 0 even in
> presence of
> an error in its output.
>
> Fixes Issue 744.
>
> Signed-off-by: Michele Tartara <[email protected]>
> ---
>  lib/cmdlib/cluster.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/cmdlib/cluster.py b/lib/cmdlib/cluster.py
> index c8ab390..fa45eb6 100644
> --- a/lib/cmdlib/cluster.py
> +++ b/lib/cmdlib/cluster.py
> @@ -3262,7 +3262,7 @@ class LUClusterVerifyGroup(LogicalUnit,
> _VerifyErrors):
>              feedback_fn("%s" % output)
>              lu_result = False
>
> -    return lu_result
> +    return lu_result and not self.bad
>
>
>  class LUClusterVerifyDisks(NoHooksLU):
> --
> 1.9.0.279.gdc9e3eb
>
>


-- 
Thomas Thrainer | Software Engineer | [email protected] |

Google Germany GmbH
Dienerstr. 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores

Reply via email to