Revision 09ab9fb2

b/src/Ganeti/HTools/Loader.hs
30 30
  ( mergeData
31 31
  , checkData
32 32
  , assignIndices
33
  , setMaster
33 34
  , lookupNode
34 35
  , lookupInstance
35 36
  , lookupGroup
......
127 128
          . zip [0..] $ name_element
128 129
  in (M.fromList name_idx, Container.fromList idx_element)
129 130

  
131
-- | Given am indexed node list, and the name of the master, mark it as such. 
132
setMaster :: (Monad m) => NameAssoc -> Node.List -> String -> m Node.List
133
setMaster node_names node_idx master = do
134
  kmaster <- maybe (fail $ "Master node " ++ master ++ " unknown") return $
135
             M.lookup master node_names
136
  let mnode = Container.find kmaster node_idx
137
  return $ Container.add kmaster (Node.setMaster mnode True) node_idx
138

  
130 139
-- | For each instance, add its index to its primary and secondary nodes.
131 140
fixNodes :: Node.List
132 141
         -> Instance.Instance

Also available in: Unified diff