summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Docker.hs
diff options
context:
space:
mode:
authorJoey Hess2014-12-08 01:06:19 -0400
committerJoey Hess2014-12-08 01:07:25 -0400
commit4e9b01a8a7005905ecec37d1cd6a11d3b27676b7 (patch)
tree13afcfd63dd6522990ac19a63cb51e1a689391ac /src/Propellor/Property/Docker.hs
parent42a0c832483296fb111279fc3512a3dfd44f2089 (diff)
propellor spin
(cherry picked from commit 1d02d589c79781cc4b0bd82467edbdf64c40f34d)
Diffstat (limited to 'src/Propellor/Property/Docker.hs')
-rw-r--r--src/Propellor/Property/Docker.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Propellor/Property/Docker.hs b/src/Propellor/Property/Docker.hs
index 5fa06517..5006ed9a 100644
--- a/src/Propellor/Property/Docker.hs
+++ b/src/Propellor/Property/Docker.hs
@@ -379,9 +379,10 @@ runningContainer cid@(ContainerId hn cn) image runps = containerDesc cid $ prope
createDirectoryIfMissing True (takeDirectory $ identFile cid)
shim <- liftIO $ Shim.setup (localdir </> "propellor") Nothing (localdir </> shimdir cid)
liftIO $ writeFile (identFile cid) (show ident)
- ensureProperty $ boolProperty "run" $ runContainer img
- (runps ++ ["-i", "-d", "-t"])
- [shim, "--continue", show (DockerInit (fromContainerId cid))]
+ ensureProperty $ property "run" $ liftIO $
+ toResult <$> runContainer img
+ (runps ++ ["-i", "-d", "-t"])
+ [shim, "--continue", show (DockerInit (fromContainerId cid))]
-- | Called when propellor is running inside a docker container.
-- The string should be the container's ContainerId.
@@ -466,7 +467,7 @@ stoppedContainer :: ContainerId -> Property
stoppedContainer cid = containerDesc cid $ property desc $
ifM (liftIO $ elem cid <$> listContainers RunningContainers)
( liftIO cleanup `after` ensureProperty
- (boolProperty desc $ stopContainer cid)
+ (property desc $ liftIO $ toResult <$> stopContainer cid)
, return NoChange
)
where