propellor spin
This commit is contained in:
parent
e6d9c792e7
commit
f31f8e8358
|
@ -227,11 +227,9 @@ runningContainer cid@(ContainerId hn cn) image containerprops = containerDesc ci
|
||||||
-- parameters of the container differ and it must
|
-- parameters of the container differ and it must
|
||||||
-- be restarted.
|
-- be restarted.
|
||||||
runningident <- getrunningident
|
runningident <- getrunningident
|
||||||
print runningident
|
|
||||||
if runningident == Just ident
|
if runningident == Just ident
|
||||||
then return NoChange
|
then return NoChange
|
||||||
else do
|
else do
|
||||||
error "container parameters changed"
|
|
||||||
void $ stopContainer cid
|
void $ stopContainer cid
|
||||||
restartcontainer
|
restartcontainer
|
||||||
else ifM (elem cid <$> listContainers AllContainers)
|
else ifM (elem cid <$> listContainers AllContainers)
|
||||||
|
@ -247,9 +245,8 @@ runningContainer cid@(ContainerId hn cn) image containerprops = containerDesc ci
|
||||||
go oldimage
|
go oldimage
|
||||||
|
|
||||||
getrunningident :: IO (Maybe ContainerIdent)
|
getrunningident :: IO (Maybe ContainerIdent)
|
||||||
getrunningident = simpleShClient (namedPipe cid) "cat" [propellorIdent] $ \rs -> do
|
getrunningident = simpleShClient (namedPipe cid) "cat" [propellorIdent] $
|
||||||
print (rs, extractident rs)
|
return . extractident
|
||||||
return $ extractident rs
|
|
||||||
|
|
||||||
extractident :: [Resp] -> Maybe ContainerIdent
|
extractident :: [Resp] -> Maybe ContainerIdent
|
||||||
extractident = headMaybe . catMaybes . map (readish :: String -> Maybe ContainerIdent) . catMaybes . map getStdout
|
extractident = headMaybe . catMaybes . map (readish :: String -> Maybe ContainerIdent) . catMaybes . map getStdout
|
||||||
|
|
Loading…
Reference in New Issue