Revision 2cdaf225 htools/Ganeti/HTools/ExtLoader.hs
b/htools/Ganeti/HTools/ExtLoader.hs | ||
---|---|---|
55 | 55 |
|
56 | 56 |
-- | Error beautifier. |
57 | 57 |
wrapIO :: IO (Result a) -> IO (Result a) |
58 |
wrapIO = flip catch (\e -> return . Bad . show $ (e::IOException))
|
|
58 |
wrapIO = handle (\e -> return . Bad . show $ (e::IOException))
|
|
59 | 59 |
|
60 | 60 |
-- | Parses a user-supplied utilisation string. |
61 | 61 |
parseUtilisation :: String -> Result (String, DynUtil) |
... | ... | |
102 | 102 |
input_data <- |
103 | 103 |
case () of |
104 | 104 |
_ | setRapi -> wrapIO $ Rapi.loadData mhost |
105 |
| setLuxi -> wrapIO $ Luxi.loadData $ fromJust lsock
|
|
105 |
| setLuxi -> wrapIO . Luxi.loadData $ fromJust lsock
|
|
106 | 106 |
| setSim -> Simu.loadData simdata |
107 |
| setFile -> wrapIO $ Text.loadData $ fromJust tfile
|
|
108 |
| setIAllocSrc -> wrapIO $ IAlloc.loadData $ fromJust iallocsrc
|
|
107 |
| setFile -> wrapIO . Text.loadData $ fromJust tfile
|
|
108 |
| setIAllocSrc -> wrapIO . IAlloc.loadData $ fromJust iallocsrc
|
|
109 | 109 |
| otherwise -> return $ Bad "No backend selected! Exiting." |
110 | 110 |
|
111 | 111 |
let ldresult = input_data >>= mergeData util_data exTags selInsts exInsts |
Also available in: Unified diff