Revision 7dbe4c72 src/Ganeti/HTools/Program/Hroller.hs
b/src/Ganeti/HTools/Program/Hroller.hs | ||
---|---|---|
61 | 61 |
, oNoHeaders |
62 | 62 |
, oSaveCluster |
63 | 63 |
, oGroup |
64 |
, oForce |
|
64 | 65 |
] |
65 | 66 |
|
66 | 67 |
-- | The list of arguments supported by the program. |
... | ... | |
112 | 113 |
unless (null args) $ exitErr "This program doesn't take any arguments." |
113 | 114 |
|
114 | 115 |
let verbose = optVerbose opts |
116 |
maybeExit = if optForce opts then warn else exitErr |
|
115 | 117 |
|
116 | 118 |
-- Load cluster data. The last two arguments, cluster tags and ipolicy, are |
117 | 119 |
-- currently not used by this tool. |
118 | 120 |
ini_cdata@(ClusterData gl fixed_nl ilf _ _) <- loadExternalData opts |
119 | 121 |
|
122 |
let master_names = map Node.name . filter Node.isMaster . IntMap.elems $ |
|
123 |
fixed_nl |
|
124 |
case master_names of |
|
125 |
[] -> maybeExit "No master node found (maybe not supported by backend)." |
|
126 |
[ _ ] -> return () |
|
127 |
_ -> exitErr $ "Found more than one master node: " ++ show master_names |
|
128 |
|
|
120 | 129 |
nlf <- setNodeStatus opts fixed_nl |
121 | 130 |
|
122 | 131 |
maybeSaveData (optSaveCluster opts) "original" "before hroller run" ini_cdata |
Also available in: Unified diff