On Mon, Dec 01, 2014 at 02:52:42PM +0100, 'Aaron Karper' via ganeti-devel wrote:
> 'allNodes' actually returns a list of instance indices corresponding to
> the nodes.
>
> Signed-off-by: Aaron Karper <[email protected]>
> ---
> src/Ganeti/HTools/Cluster.hs | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/Ganeti/HTools/Cluster.hs b/src/Ganeti/HTools/Cluster.hs
> index 0dcc9b7..368c43f 100644
> --- a/src/Ganeti/HTools/Cluster.hs
> +++ b/src/Ganeti/HTools/Cluster.hs
> @@ -231,10 +231,10 @@ computeBadItems :: Node.List -> Instance.List ->
> ([Node.Node], [Instance.Instance])
> computeBadItems nl il =
> let bad_nodes = verifyN1 $ getOnline nl
> - allNodes n = Node.sList n ++ Node.pList n
> + allInstances n = Node.sList n ++ Node.pList n
> bad_instances = map (`Container.find` il) .
> sort . nub $
> - concatMap allNodes bad_nodes
> + concatMap allInstances bad_nodes
> in
> (bad_nodes, bad_instances)
Which version of the code is your patch against? The function computeBadItems on
current master reads
computeBadItems :: Node.List -> Instance.List ->
([Node.Node], [Instance.Instance])
computeBadItems nl il =
let bad_nodes = verifyN1 $ getOnline nl
bad_instances = map (`Container.find` il) .
sort . nub $
concatMap (\ n -> Node.sList n ++ Node.pList n)
bad_nodes
in
(bad_nodes, bad_instances)
and has not changed since February 2010. Moreover, the current variant is
at least as readable as the the result of your patch being applied to some
code where it applies. So I don't see the benefit.
--
Klaus Aehlig
Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores