Revision 4938fa30 htools/Ganeti/HTools/Program/Hspace.hs
b/htools/Ganeti/HTools/Program/Hspace.hs | ||
---|---|---|
46 | 46 |
import Ganeti.HTools.Types |
47 | 47 |
import Ganeti.HTools.CLI |
48 | 48 |
import Ganeti.HTools.ExtLoader |
49 |
import Ganeti.HTools.Loader (ClusterData(..))
|
|
49 |
import Ganeti.HTools.Loader |
|
50 | 50 |
|
51 | 51 |
-- | Options list and functions |
52 | 52 |
options :: [OptType] |
... | ... | |
246 | 246 |
|
247 | 247 |
let num_instances = length $ Container.elems il |
248 | 248 |
|
249 |
let offline_names = optOffline opts
|
|
249 |
let offline_passed = optOffline opts
|
|
250 | 250 |
all_nodes = Container.elems fixed_nl |
251 |
all_names = map Node.name all_nodes |
|
252 |
offline_wrong = filter (`notElem` all_names) offline_names |
|
251 |
offline_lkp = map (lookupName (map Node.name all_nodes)) offline_passed |
|
252 |
offline_wrong = filter (not . goodLookupResult) offline_lkp |
|
253 |
offline_names = map lrContent offline_lkp |
|
253 | 254 |
offline_indices = map Node.idx $ |
254 |
filter (\n -> |
|
255 |
Node.name n `elem` offline_names || |
|
256 |
Node.alias n `elem` offline_names) |
|
255 |
filter (\n -> Node.name n `elem` offline_names) |
|
257 | 256 |
all_nodes |
258 | 257 |
m_cpu = optMcpu opts |
259 | 258 |
m_dsk = optMdsk opts |
260 | 259 |
|
261 |
when (length offline_wrong > 0) $ do
|
|
260 |
when (not (null offline_wrong)) $ do
|
|
262 | 261 |
hPrintf stderr "Error: Wrong node name(s) set as offline: %s\n" |
263 |
(commaJoin offline_wrong) :: IO ()
|
|
262 |
(commaJoin (map lrContent offline_wrong)) :: IO ()
|
|
264 | 263 |
exitWith $ ExitFailure 1 |
265 | 264 |
|
266 | 265 |
when (req_nodes /= 1 && req_nodes /= 2) $ do |
Also available in: Unified diff