Log RPC errors from inside executeRpcCall
[ganeti-local] / src / Ganeti / Query / Node.hs
index 36b5000..293ceb7 100644 (file)
@@ -36,7 +36,6 @@ import qualified Data.Map as Map
 import qualified Text.JSON as J
 
 import Ganeti.Config
-import Ganeti.Logging
 import Ganeti.Objects
 import Ganeti.JSON
 import Ganeti.Rpc
@@ -215,15 +214,6 @@ fieldsMap :: FieldMap Node Runtime
 fieldsMap =
   Map.fromList $ map (\v@(f, _, _) -> (fdefName f, v)) nodeFields
 
--- | Scan the list of results produced by executeRpcCall and log all the RPC
--- errors.
-logRpcErrors :: [(Node, Runtime)] -> IO ()
-logRpcErrors allElems =
-  let logOneRpcErr (_, Right _) = return ()
-      logOneRpcErr (_, Left err) =
-        logError $ "Error in the RPC HTTP reply: " ++ show err
-  in mapM_ logOneRpcErr allElems
-
 -- | Collect live data from RPC query if enabled.
 --
 -- FIXME: Check which fields we actually need and possibly send empty
@@ -243,7 +233,6 @@ collectLiveData True cfg nodes = do
              Nothing -> (n : bn, gn, em)
       (bnodes, gnodes, emap) = foldr step ([], [], []) nodes
   rpcres <- executeRpcCall gnodes (RpcCallNodeInfo vgs hvs (Map.fromList emap))
-  logRpcErrors rpcres
   -- FIXME: The order of nodes in the result could be different from the input
   return $ zip bnodes (repeat $ Left (RpcResultError "Broken configuration"))
            ++ rpcres