Revision 4938fa30 htools/Ganeti/HTools/Program/Hbal.hs
b/htools/Ganeti/HTools/Program/Hbal.hs | ||
---|---|---|
49 | 49 |
import Ganeti.HTools.ExtLoader |
50 | 50 |
import Ganeti.HTools.Utils |
51 | 51 |
import Ganeti.HTools.Types |
52 |
import Ganeti.HTools.Loader (ClusterData(..))
|
|
52 |
import Ganeti.HTools.Loader |
|
53 | 53 |
|
54 | 54 |
import qualified Ganeti.Luxi as L |
55 | 55 |
import Ganeti.Jobs |
... | ... | |
240 | 240 |
|
241 | 241 |
ini_cdata@(ClusterData gl fixed_nl ilf ctags) <- loadExternalData opts |
242 | 242 |
|
243 |
let offline_names = optOffline opts
|
|
243 |
let offline_passed = optOffline opts
|
|
244 | 244 |
all_nodes = Container.elems fixed_nl |
245 |
all_names = concatMap allNames all_nodes |
|
246 |
offline_wrong = filter (`notElem` all_names) offline_names |
|
245 |
offline_lkp = map (lookupName (map Node.name all_nodes)) offline_passed |
|
246 |
offline_wrong = filter (not . goodLookupResult) offline_lkp |
|
247 |
offline_names = map lrContent offline_lkp |
|
247 | 248 |
offline_indices = map Node.idx $ |
248 |
filter (\n -> |
|
249 |
Node.name n `elem` offline_names || |
|
250 |
Node.alias n `elem` offline_names) |
|
249 |
filter (\n -> Node.name n `elem` offline_names) |
|
251 | 250 |
all_nodes |
252 | 251 |
m_cpu = optMcpu opts |
253 | 252 |
m_dsk = optMdsk opts |
254 | 253 |
csf = commonSuffix fixed_nl ilf |
255 | 254 |
|
256 |
when (length offline_wrong > 0) $ do
|
|
257 |
hPrintf stderr "Wrong node name(s) set as offline: %s\n" |
|
258 |
(commaJoin offline_wrong) :: IO ()
|
|
255 |
when (not (null offline_wrong)) $ do
|
|
256 |
hPrintf stderr "Error: Wrong node name(s) set as offline: %s\n"
|
|
257 |
(commaJoin (map lrContent offline_wrong)) :: IO ()
|
|
259 | 258 |
exitWith $ ExitFailure 1 |
260 | 259 |
|
261 | 260 |
let nm = Container.map (\n -> if Node.idx n `elem` offline_indices |
Also available in: Unified diff