Revision 707cd3d7 htools/Ganeti/HTools/Program/Hail.hs
b/htools/Ganeti/HTools/Program/Hail.hs | ||
---|---|---|
32 | 32 |
import Control.Monad |
33 | 33 |
import Data.Maybe (fromMaybe, isJust) |
34 | 34 |
import System.IO |
35 |
import System.Exit |
|
36 | 35 |
|
37 | 36 |
import qualified Ganeti.HTools.Cluster as Cluster |
38 | 37 |
|
... | ... | |
41 | 40 |
import Ganeti.HTools.IAlloc |
42 | 41 |
import Ganeti.HTools.Loader (Request(..), ClusterData(..)) |
43 | 42 |
import Ganeti.HTools.ExtLoader (maybeSaveData, loadExternalData) |
43 |
import Ganeti.Utils |
|
44 | 44 |
|
45 | 45 |
-- | Options list and functions. |
46 | 46 |
options :: [OptType] |
... | ... | |
58 | 58 |
|
59 | 59 |
wrapReadRequest :: Options -> [String] -> IO Request |
60 | 60 |
wrapReadRequest opts args = do |
61 |
when (null args) $ do |
|
62 |
hPutStrLn stderr "Error: this program needs an input file." |
|
63 |
exitWith $ ExitFailure 1 |
|
61 |
when (null args) $ exitErr "This program needs an input file." |
|
64 | 62 |
|
65 | 63 |
r1 <- readRequest (head args) |
66 | 64 |
if isJust (optDataFile opts) || (not . null . optNodeSim) opts |
Also available in: Unified diff