Revision 2cdaf225 htools/Ganeti/Rpc.hs
b/htools/Ganeti/Rpc.hs | ||
---|---|---|
102 | 102 |
"Node " ++ nodeName node ++ " is marked as offline" |
103 | 103 |
|
104 | 104 |
rpcErrorJsonReport :: (Monad m) => J.Result a -> m (Either RpcError a) |
105 |
rpcErrorJsonReport (J.Error x) = return $ Left $ JsonDecodeError x
|
|
105 |
rpcErrorJsonReport (J.Error x) = return . Left $ JsonDecodeError x
|
|
106 | 106 |
rpcErrorJsonReport (J.Ok x) = return $ Right x |
107 | 107 |
|
108 | 108 |
-- | Basic timeouts for RPC calls. |
... | ... | |
162 | 162 |
url = requestUrl request |
163 | 163 |
-- FIXME: This is very similar to getUrl in Htools/Rapi.hs |
164 | 164 |
(code, !body) <- curlGetString url $ curlOpts ++ reqOpts |
165 |
case code of |
|
166 |
CurlOK -> return $ Right body
|
|
167 |
_ -> return $ Left $ CurlLayerError node (show code)
|
|
165 |
return $ case code of
|
|
166 |
CurlOK -> Right body
|
|
167 |
_ -> Left $ CurlLayerError node (show code)
|
|
168 | 168 |
#endif |
169 | 169 |
|
170 | 170 |
-- | Prepare url for the HTTP request. |
Also available in: Unified diff