diff options
| author | Joey Hess <joey@kitenet.net> | 2014-04-04 15:47:06 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-04-04 15:47:06 -0400 |
| commit | e6d9c792e72848e7977020fa9a3311fefff8e710 (patch) | |
| tree | 628669b514c03da6cf6870a0c9b498feb78a9032 /Propellor | |
| parent | b9e7721db0fedbbc6d1d32f54fbf011e0514e9df (diff) | |
propellor spin
Diffstat (limited to 'Propellor')
| -rw-r--r-- | Propellor/Property/Docker.hs | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/Propellor/Property/Docker.hs b/Propellor/Property/Docker.hs index bcd27c59..e96603f5 100644 --- a/Propellor/Property/Docker.hs +++ b/Propellor/Property/Docker.hs @@ -233,23 +233,19 @@ runningContainer cid@(ContainerId hn cn) image containerprops = containerDesc ci else do error "container parameters changed" void $ stopContainer cid - oldimage <- fromMaybe image <$> commitContainer cid - void $ removeContainer cid - go oldimage - else do - ifM (elem cid <$> listContainers AllContainers) - ( do - -- Contaner may be stopped, or - -- may not exist. - void $ stopContainer cid - oldimage <- fromMaybe image <$> commitContainer cid - void $ removeContainer cid - go oldimage - , go image - ) + restartcontainer + else ifM (elem cid <$> listContainers AllContainers) + ( restartcontainer + , go image + ) where ident = ContainerIdent image hn cn runps + restartcontainer = do + oldimage <- fromMaybe image <$> commitContainer cid + void $ removeContainer cid + go oldimage + getrunningident :: IO (Maybe ContainerIdent) getrunningident = simpleShClient (namedPipe cid) "cat" [propellorIdent] $ \rs -> do print (rs, extractident rs) |
