From 0274aec9491a4bacfc15ec302c9280a0d88046a1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Apr 2014 00:48:37 -0400 Subject: [PATCH] propellor spin --- Propellor/Property/Docker.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Propellor/Property/Docker.hs b/Propellor/Property/Docker.hs index edf12c2e..b75b2bf 100644 --- a/Propellor/Property/Docker.hs +++ b/Propellor/Property/Docker.hs @@ -218,6 +218,9 @@ toContainerId s fromContainerId :: ContainerId -> String fromContainerId (ContainerId hn cn) = cn++"."++hn++myContainerSuffix +containerHostName :: ContainerId -> HostName +containerHostName (ContainerId _ cn) = cn + myContainerSuffix :: String myContainerSuffix = ".propellor" @@ -299,7 +302,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 $ fromContainerId cid]) $ + unlessM (boolSystem shim [Param "--continue", Param $ show $ Chain $ containerHostName cid]) $ warningMessage "Boot provision failed!" void $ async $ job reapzombies void $ async $ job $ simpleSh $ namedPipe cid @@ -328,7 +331,7 @@ provisionContainer cid = containerDesc cid $ Property "provision" $ liftIO $ do setProvisionedFlag cid return r where - params = ["--continue", show $ Chain $ fromContainerId cid] + params = ["--continue", show $ Chain $ containerHostName cid] go lastline (v:rest) = case v of StdoutLine s -> do