Revision be0cb2d7 src/Ganeti/Query/Query.hs

b/src/Ganeti/Query/Query.hs
53 53
    ) where
54 54

  
55 55
import Control.DeepSeq
56
import Control.Monad (filterM, liftM, foldM)
56
import Control.Monad (filterM, foldM)
57 57
import Control.Monad.Trans (lift)
58 58
import Data.List (intercalate)
59 59
import Data.Maybe (fromMaybe)
......
218 218
             Bad msg -> resultT . Bad $ GenericError msg
219 219
             Ok [] -> if live
220 220
                        -- we can check the filesystem for actual jobs
221
                        then lift $ liftM sortJobIDs
222
                             (determineJobDirectories rootdir want_arch >>=
223
                              getJobIDs)
221
                        then do
222
                          maybeJobIDs <-
223
                            lift (determineJobDirectories rootdir want_arch
224
                              >>= getJobIDs)
225
                          case maybeJobIDs of
226
                            Left e -> (resultT . Bad) . BlockDeviceError $
227
                              "Unable to fetch the job list: " ++ show e
228
                            Right jobIDs -> resultT . Ok $ sortJobIDs jobIDs
224 229
                        -- else we shouldn't look at the filesystem...
225 230
                        else return []
226 231
             Ok v -> resultT $ Ok v

Also available in: Unified diff