From 5a5adab86788d93103803df27a1004d0d9696b1d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 14 May 2014 19:34:26 -0400 Subject: remove simplsh debug code Seems I have really fixed that bug! --- Propellor/SimpleSh.hs | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'Propellor/SimpleSh.hs') diff --git a/Propellor/SimpleSh.hs b/Propellor/SimpleSh.hs index 69ded47b..7ba30b0e 100644 --- a/Propellor/SimpleSh.hs +++ b/Propellor/SimpleSh.hs @@ -36,11 +36,9 @@ simpleSh namedpipe = do maybe noop (run h) . readish =<< hGetLine h where run h (Cmd cmd params) = do - debug ["simplesh run", cmd, show params] chan <- newChan let runwriter = do v <- readChan chan - debug ["simplesh run", cmd, show params, "writer got:", show v] hPutStrLn h (show v) hFlush h case v of @@ -55,7 +53,6 @@ simpleSh namedpipe = do , std_err = CreatePipe } (Nothing, Just outh, Just errh, pid) <- createProcess p - debug ["simplesh run", cmd, show params, "started"] let mkreader t from = maybe noop (const $ mkreader t from) =<< catchMaybeIO (writeChan chan . t =<< hGetLine from) @@ -63,33 +60,25 @@ simpleSh namedpipe = do (mkreader StdoutLine outh) (mkreader StderrLine errh) - debug ["simplesh run", cmd, show params, "waiting for process"] void $ tryIO $ waitForProcess pid - debug ["simplesh run", cmd, show params, "sending Done"] writeChan chan Done hClose outh hClose errh - debug ["simplesh run", cmd, show params, "wait writer"] wait writer - debug ["simplesh run", cmd, show params, "wait writer complete"] hClose h - debug ["simplesh run", cmd, show params, "fully done"] simpleShClient :: FilePath -> String -> [String] -> ([Resp] -> IO a) -> IO a simpleShClient namedpipe cmd params handler = do - debug ["simplesh connecting"] s <- socket AF_UNIX Stream defaultProtocol connect s (SockAddrUnix namedpipe) h <- socketToHandle s ReadWriteMode hPutStrLn h $ show $ Cmd cmd params hFlush h - debug ["simplesh sent command"] resps <- catMaybes . map readish . lines <$> hGetContents h v <- hClose h `after` handler resps - debug ["simplesh processed response"] return v simpleShClientRetry :: Int -> FilePath -> String -> [String] -> ([Resp] -> IO a) -> IO a -- cgit v1.2.3