Commit 08fd383d authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix htools/rpc-test after recent changes

Since this program is not built normally, a few recent commits broke
it:

- 707cd3d7 (“Use exitErr instead of explicit error message and
  exitWith”) introduced wrong syntax (missing '$')
- 29a30533 (“Remove unsafePerformIO usage”) changed the signature of
  G.Path.clusterConfFile
- 5183e8be

 (“Convert query path from string errors to GanetiException”)
  changed the signature of 'getNode'
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent dc4b5c42
......@@ -24,9 +24,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-}
import System.Environment
import System.Exit
import System.IO
import Ganeti.Errors
import Ganeti.Config
import Ganeti.Objects
import qualified Ganeti.Path as P
......@@ -37,7 +36,7 @@ import Ganeti.Utils
usage :: IO ()
usage = do
prog <- getProgName
exitErr "Usage: " ++ prog ++ " delay node..."
exitErr $ "Usage: " ++ prog ++ " delay node..."
main :: IO ()
main = do
......@@ -46,10 +45,11 @@ main = do
[] -> usage >> return ("", []) -- workaround types...
_:[] -> usage >> return ("", [])
x:xs -> return (x, xs)
cfg <- loadConfig P.clusterConfFile >>=
exitIfBad "Can't load configuration"
cfg_file <- P.clusterConfFile
cfg <- loadConfig cfg_file>>= exitIfBad "Can't load configuration"
let call = RpcCallTestDelay (read delay)
nodes' <- exitIfBad "Can't find node" $ mapM (getNode cfg) nodes
nodes' <- exitIfBad "Can't find node" . errToResult $
mapM (getNode cfg) nodes
results <- executeRpcCall nodes' call
putStr $ printTable "" ["Node", "Result"]
(map (\(n, r) -> [nodeName n, show r]) results) [False, False]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment