Commit 15329af5 authored by Iustin Pop's avatar Iustin Pop
Browse files

htools: use maybePrintNodes in hail.hs



This eliminates duplication of codes (and was forgotten back when
maybePrintNodes was added).
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 4162995d
......@@ -26,7 +26,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
module Main (main) where
import Control.Monad
import Data.Maybe (isJust, fromJust)
import System.IO
import qualified System
......@@ -69,19 +68,16 @@ main = do
when (verbose > 2) $
hPutStrLn stderr $ "Received cluster data: " ++ show cdata
when (isJust shownodes) $ do
hPutStrLn stderr "Initial cluster status:"
hPutStrLn stderr $ Cluster.printNodes (cdNodes cdata)
(fromJust shownodes)
maybePrintNodes shownodes "Initial cluster"
(Cluster.printNodes (cdNodes cdata))
maybeSaveData savecluster "pre-ialloc" "before iallocator run" cdata
let (maybe_ni, resp) = runIAllocator request
(fin_nl, fin_il) = maybe (cdNodes cdata, cdInstances cdata) id maybe_ni
putStrLn resp
when (isJust shownodes) $ do
hPutStrLn stderr "Final cluster status:"
hPutStrLn stderr $ Cluster.printNodes fin_nl (fromJust shownodes)
maybePrintNodes shownodes "Final cluster" (Cluster.printNodes fin_nl)
maybeSaveData savecluster "post-ialloc" "after iallocator run"
(cdata { cdNodes = fin_nl, cdInstances = fin_il})
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