summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2014-03-31 12:14:45 -0400
committerJoey Hess2014-03-31 12:14:45 -0400
commitc5495fecc0336d57d1a320810a89cd99672882db (patch)
treedfe13ed1539a1e56a5cbbd937e71069d5319ad05
parent8e36dedf95add9be8ff44550c71ebe1cdda3d434 (diff)
propellor spin
-rw-r--r--Propellor/CmdLine.hs8
1 files changed, 8 insertions, 0 deletions
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