summaryrefslogtreecommitdiff
path: root/Propellor
diff options
context:
space:
mode:
authorJoey Hess2014-03-31 14:22:48 -0400
committerJoey Hess2014-03-31 14:22:48 -0400
commit5c814d378063f3c3aeb1dfe4021bc0a3c991056a (patch)
treedfef4cc240e9ca046c221b203b5fc4c6b47ff9de /Propellor
parent53ece3a155fb7e06af4099764c267d8cf7a7f340 (diff)
propellor spin
Diffstat (limited to 'Propellor')
-rw-r--r--Propellor/CmdLine.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Propellor/CmdLine.hs b/Propellor/CmdLine.hs
index e4a73d5b..69e68351 100644
--- a/Propellor/CmdLine.hs
+++ b/Propellor/CmdLine.hs
@@ -100,9 +100,13 @@ spin host = do
, "./propellor --boot " ++ host
]
getstatus :: Handle -> IO BootStrapStatus
- getstatus h = maybe (getstatus h) return
- . (readish <=< fromMarked statusMarker)
- =<< hGetLine h
+ getstatus h = do
+ l <- hGetLine h
+ case readish =<< fromMarked statusMarker l of
+ Nothing -> do
+ putStrLn l
+ getstatus h
+ Just status -> return status
data BootStrapStatus = HaveKeyRing | NeedKeyRing
deriving (Read, Show, Eq)