Revision 497e30a1 Ganeti/HTools/Loader.hs

b/Ganeti/HTools/Loader.hs
28 28
      Nothing -> fail $ "Unknown node '" ++ node ++ "' for instance " ++ inst
29 29
      Just idx -> return idx
30 30

  
31
assignIndices :: (a -> Int -> a)
32
              -> [(String, a)]
31
assignIndices :: (Element a) =>
32
                 [(String, a)]
33 33
              -> (NameAssoc, [(Int, a)])
34
assignIndices set_fn =
35
    unzip . map (\ (idx, (k, v)) -> ((k, idx), (idx, set_fn v idx)))
34
assignIndices =
35
    unzip . map (\ (idx, (k, v)) -> ((k, idx), (idx, setIdx v idx)))
36 36
          . zip [0..]
37 37

  
38 38
-- | For each instance, add its index to its primary and secondary nodes

Also available in: Unified diff