computeBadItems :: NodeList -> InstanceList ->
([Node.Node], [Instance.Instance])
computeBadItems nl il =
- let bad_nodes = verifyN1 $ Container.elems nl
+ let bad_nodes = verifyN1 $ filter (not . Node.offline) $ Container.elems nl
bad_instances = map (\idx -> Container.find idx il) $
sort $ nub $ concat $
map (\ n -> (Node.slist n) ++ (Node.plist n)) bad_nodes
and massages it into the correct format. -}
loadData :: String -- ^ Node data in text format
-> String -- ^ Instance data in text format
- -> (Container.Container Node.Node,
- Container.Container Instance.Instance,
- String, NameList, NameList)
+ -> Result (Container.Container Node.Node,
+ Container.Container Instance.Instance,
+ String, NameList, NameList)
loadData ndata idata =
let
{- node file: name t_mem n_mem f_mem t_disk f_disk -}
stn = stripSuffix common_suffix xtn
sti = stripSuffix common_suffix xti
in
- (nl3, il3, common_suffix, stn, sti)
+ Ok (nl3, il3, common_suffix, stn, sti)
-- | Compute the amount of memory used by primary instances on a node.
nodeImem :: Node.Node -> InstanceList -> Int