From 4a0cac113cf999a58a60f7db7a11d5b0ad623699 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 18 Nov 2014 17:53:42 -0400 Subject: fix color display when running propellor inside docker --- src/Propellor/Property/Docker.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Propellor/Property/Docker.hs') diff --git a/src/Propellor/Property/Docker.hs b/src/Propellor/Property/Docker.hs index 5a7a0840..d005592e 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -416,7 +416,7 @@ chain s = case toContainerId s of -- to avoid ever provisioning twice at the same time. whenM (checkProvisionedFlag cid) $ do let shim = Shim.file (localdir "propellor") (localdir shimdir cid) - unlessM (boolSystem shim [Param "--continue", Param $ show $ Chain $ containerHostName cid]) $ + unlessM (boolSystem shim [Param "--continue", Param $ show $ Chain (containerHostName cid) False]) $ warningMessage "Boot provision failed!" void $ async $ job reapzombies void $ async $ job $ simpleSh $ namedPipe cid @@ -440,13 +440,13 @@ chain s = case toContainerId s of provisionContainer :: ContainerId -> Property provisionContainer cid = containerDesc cid $ property "provisioned" $ liftIO $ do let shim = Shim.file (localdir "propellor") (localdir shimdir cid) + msgh <- mkMessageHandle + let params = ["--continue", show $ Chain (containerHostName cid) (isConsole msgh)] r <- simpleShClientRetry 60 (namedPipe cid) shim params (go Nothing) when (r /= FailedChange) $ setProvisionedFlag cid return r where - params = ["--continue", show $ Chain $ containerHostName cid] - go lastline (v:rest) = case v of StdoutLine s -> do maybe noop putStrLn lastline -- cgit v1.3-2-g0d8e From 2bbb2aa6e2be7152f9532fb45a098b816a92217b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 18 Nov 2014 18:49:32 -0400 Subject: remove --docker; use Continue And --chain was already not used. --- src/Propellor/CmdLine.hs | 3 --- src/Propellor/Property/Docker.hs | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'src/Propellor/Property/Docker.hs') diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index 8220cbe2..df4d44a6 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -51,9 +51,6 @@ processCmdLine = go =<< getArgs go ("--continue":s:[]) = case readish s of Just cmdline -> return $ Continue cmdline Nothing -> errorMessage "--continue serialization failure" - go ("--chain":h:[]) = return $ Chain h False - go ("--chain":h:b:[]) = return $ Chain h (Prelude.read b) - go ("--docker":h:[]) = return $ Docker h go (h:[]) | "--" `isPrefixOf` h = usage | otherwise = return $ Run h diff --git a/src/Propellor/Property/Docker.hs b/src/Propellor/Property/Docker.hs index d005592e..491955dd 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -385,7 +385,7 @@ runningContainer cid@(ContainerId hn cn) image runps = containerDesc cid $ prope liftIO $ writeFile (identFile cid) (show ident) ensureProperty $ boolProperty "run" $ runContainer img (runps ++ ["-i", "-d", "-t"]) - [shim, "--docker", fromContainerId cid] + [shim, "--continue", show (Docker (fromContainerId cid))] -- | Called when propellor is running inside a docker container. -- The string should be the container's ContainerId. -- cgit v1.3-2-g0d8e