From c5495fecc0336d57d1a320810a89cd99672882db Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 31 Mar 2014 12:14:45 -0400 Subject: propellor spin --- Propellor/CmdLine.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Propellor/CmdLine.hs b/Propellor/CmdLine.hs index 02616954..576062e3 100644 --- a/Propellor/CmdLine.hs +++ b/Propellor/CmdLine.hs @@ -67,7 +67,11 @@ spin host = do void $ boolSystem "git" [Param "push"] privdata <- gpgDecrypt (privDataFile host) withBothHandles createProcessSuccess (proc "ssh" [user, bootstrapcmd url]) $ \(toh, fromh) -> do + hPutStrLn stderr "PRE-STATUS" + hFlush stderr status <- readish . fromMarked statusMarker <$> hGetContents fromh + hPutStrLn stderr "POST-STATUS" + hFlush stderr case status of Nothing -> error "protocol error" Just NeedKeyRing -> do @@ -121,8 +125,12 @@ boot :: [Property] -> IO () boot props = do havering <- doesFileExist keyring putStrLn $ toMarked statusMarker $ show $ if havering then HaveKeyRing else NeedKeyRing + hPutStrLn stderr "SENT STATUS" + hFlush stderr hFlush stdout reply <- getContents + hPutStrLn stderr $ "GOT " ++ reply + hFlush stderr makePrivDataDir writeFileProtected privDataLocal $ fromMarked privDataMarker reply let keyringarmored = fromMarked keyringMarker reply -- cgit v1.2.3