always clear the provisioned flag

This commit is contained in:
Joey Hess 2014-04-02 13:28:46 -04:00
parent 16b4d16162
commit bbc4a84f4f
1 changed files with 1 additions and 2 deletions

View File

@ -230,14 +230,12 @@ runningContainer cid@(ContainerId hn cn) image containerprops = containerDesc ci
if (ident2id <$> runningident) == Just (ident2id ident) if (ident2id <$> runningident) == Just (ident2id ident)
then return NoChange then return NoChange
else do else do
clearProvisionedFlag cid
void $ stopContainer cid void $ stopContainer cid
oldimage <- fromMaybe image <$> commitContainer cid oldimage <- fromMaybe image <$> commitContainer cid
void $ removeContainer cid void $ removeContainer cid
go oldimage go oldimage
else do else do
whenM (elem cid <$> listContainers AllContainers) $ do whenM (elem cid <$> listContainers AllContainers) $ do
clearProvisionedFlag cid
void $ removeContainer cid void $ removeContainer cid
go image go image
where where
@ -258,6 +256,7 @@ runningContainer cid@(ContainerId hn cn) image containerprops = containerDesc ci
chaincmd = [localdir </> "propellor", "--docker", fromContainerId cid] chaincmd = [localdir </> "propellor", "--docker", fromContainerId cid]
go img = do go img = do
clearProvisionedFlag cid
createDirectoryIfMissing True (takeDirectory $ identFile cid) createDirectoryIfMissing True (takeDirectory $ identFile cid)
writeFile (identFile cid) (show ident) writeFile (identFile cid) (show ident)
ifM (runContainer img (runps ++ ["-i", "-d", "-t"]) chaincmd) ifM (runContainer img (runps ++ ["-i", "-d", "-t"]) chaincmd)