From d38017a1abc1859f5fe526cc85ae9e0cc192ea00 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 21 Dec 2014 21:01:46 -0400 Subject: [PATCH 1/6] propellor spin --- config-joey.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/config-joey.hs b/config-joey.hs index 7aa94bb..7d990ca 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -109,6 +109,7 @@ clam = standardSystem "clam.kitenet.net" Unstable "amd64" & File.notPresent "/var/www/html/index.html" & "/var/www/index.html" `File.hasContent` ["hello, world"] & alias "helloworld.kitenet.net" + & Docker.docked oldusenetShellBox -- ssh on some extra ports to deal with horrible networks -- while travelling From 9444326c877d6cf6b25f6750ed9212dbc7c200cd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 21 Dec 2014 21:05:12 -0400 Subject: [PATCH 2/6] propellor spin --- config-joey.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/config-joey.hs b/config-joey.hs index 7d990ca..4525f22 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -217,6 +217,7 @@ kite = standardSystemUnhardened "kite.kitenet.net" Testing "amd64" & Docker.configured & Docker.garbageCollected `period` Daily + & Docker.docked oldusenetShellBox diatom :: Host diatom = standardSystem "diatom.kitenet.net" (Stable "wheezy") "amd64" From d194765e10eae7769210f1b1a19c08835d555fed Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 21 Dec 2014 21:14:11 -0400 Subject: [PATCH 3/6] propellor spin --- debian/changelog | 7 +++++++ src/Propellor/Engine.hs | 3 +++ src/Propellor/Property/Chroot.hs | 2 +- src/Propellor/Property/Docker.hs | 3 ++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index af96477..9e7b0cd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +propellor (1.2.2) UNRELEASED; urgency=medium + + * docker, chroot: Avoid ensureProperty warning about Info propigation, + which is handled properly for there. + + -- Joey Hess Sun, 21 Dec 2014 21:11:45 -0400 + propellor (1.2.1) unstable; urgency=medium * Added CryptPassword to PrivDataField, for password hashes as produced diff --git a/src/Propellor/Engine.hs b/src/Propellor/Engine.hs index dc8b2bc..c00597b 100644 --- a/src/Propellor/Engine.hs +++ b/src/Propellor/Engine.hs @@ -4,7 +4,9 @@ module Propellor.Engine ( mainProperties, runPropellor, ensureProperty, + ensureProperty', ensureProperties, + ensurePropertiesWith, fromHost, onlyProcess, processChainOutput, @@ -73,6 +75,7 @@ ensureProperty p = do warningMessage $ "ensureProperty called on " ++ show p ++ "; will not propigate its info: " ++ show (getInfo p) ensureProperty' p +-- | ensureProperty without the warning message. ensureProperty' :: Property -> Propellor Result ensureProperty' = catchPropellor . propertySatisfy diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs index 3da8b0d..ebd38f9 100644 --- a/src/Propellor/Property/Chroot.hs +++ b/src/Propellor/Property/Chroot.hs @@ -137,7 +137,7 @@ chain hostlist (ChrootChain hn loc systemdonly onconsole) = changeWorkingDirectory localdir when onconsole forceConsole onlyProcess (provisioningLock loc) $ do - r <- runPropellor h $ ensureProperties $ + r <- runPropellor h $ ensurePropertiesWith ensureProperty' $ if systemdonly then [Systemd.installed] else hostProperties h diff --git a/src/Propellor/Property/Docker.hs b/src/Propellor/Property/Docker.hs index b48afbb..7a06603 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -456,7 +456,8 @@ chain hostlist hn s = case toContainerId s of go cid h = do changeWorkingDirectory localdir onlyProcess (provisioningLock cid) $ do - r <- runPropellor h $ ensureProperties $ hostProperties h + r <- runPropellor h $ ensurePropertiesWith ensureProperty' $ + hostProperties h putStrLn $ "\n" ++ show r stopContainer :: ContainerId -> IO Bool From 69b546400ccc0197942eac7527fbc30cb32cc7d1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 21 Dec 2014 21:23:07 -0400 Subject: [PATCH 4/6] propellor spin From 7f35024ef2d8256dcc17edadb6a268e94974dcf1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 21 Dec 2014 21:28:22 -0400 Subject: [PATCH 5/6] propellor spin From dc36a98fc159794395512ff2ae78eb8e0acb0ea5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 21 Dec 2014 21:33:03 -0400 Subject: [PATCH 6/6] Revert ensureProperty warning message, too many false positives in places where Info is correctly propigated. Better approach needed. --- debian/changelog | 4 ++-- src/Propellor/Engine.hs | 25 ++++--------------------- src/Propellor/Property/Chroot.hs | 2 +- src/Propellor/Property/Docker.hs | 2 +- 4 files changed, 8 insertions(+), 25 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9e7b0cd..3524cb0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ propellor (1.2.2) UNRELEASED; urgency=medium - * docker, chroot: Avoid ensureProperty warning about Info propigation, - which is handled properly for there. + * Revert ensureProperty warning message, too many false positives in places + where Info is correctly propigated. Better approach needed. -- Joey Hess Sun, 21 Dec 2014 21:11:45 -0400 diff --git a/src/Propellor/Engine.hs b/src/Propellor/Engine.hs index c00597b..f29ce1a 100644 --- a/src/Propellor/Engine.hs +++ b/src/Propellor/Engine.hs @@ -4,9 +4,7 @@ module Propellor.Engine ( mainProperties, runPropellor, ensureProperty, - ensureProperty', ensureProperties, - ensurePropertiesWith, fromHost, onlyProcess, processChainOutput, @@ -25,7 +23,6 @@ import System.FilePath import System.Directory import Propellor.Types -import Propellor.Types.Empty import Propellor.Message import Propellor.Exception import Propellor.Info @@ -38,7 +35,7 @@ import Utility.Monad mainProperties :: Host -> IO () mainProperties host = do ret <- runPropellor host $ - ensureProperties [Property "overall" (ensurePropertiesWith ensureProperty' $ hostProperties host) mempty] + ensureProperties [Property "overall" (ensureProperties $ hostProperties host) mempty] h <- mkMessageHandle whenConsole h $ setTitle "propellor: done" @@ -65,31 +62,17 @@ runEndAction host res (EndAction desc a) = actionMessageOn (hostName host) desc -- | For when code running in the Propellor monad needs to ensure a -- Property. --- --- Note that any info of the Property is not propigated out to --- the enclosing Property, and so will not be available for propellor to --- use. A warning message will be printed if this is detected. ensureProperty :: Property -> Propellor Result -ensureProperty p = do - unless (isEmpty (getInfo p)) $ - warningMessage $ "ensureProperty called on " ++ show p ++ "; will not propigate its info: " ++ show (getInfo p) - ensureProperty' p - --- | ensureProperty without the warning message. -ensureProperty' :: Property -> Propellor Result -ensureProperty' = catchPropellor . propertySatisfy +ensureProperty = catchPropellor . propertySatisfy -- | Ensures a list of Properties, with a display of each as it runs. ensureProperties :: [Property] -> Propellor Result -ensureProperties = ensurePropertiesWith ensureProperty - -ensurePropertiesWith :: (Property -> Propellor Result) -> [Property] -> Propellor Result -ensurePropertiesWith a ps = ensure ps NoChange +ensureProperties ps = ensure ps NoChange where ensure [] rs = return rs ensure (p:ls) rs = do hn <- asks hostName - r <- actionMessageOn hn (propertyDesc p) (a p) + r <- actionMessageOn hn (propertyDesc p) (ensureProperty p) ensure ls (r <> rs) -- | Lifts an action into a different host. diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs index ebd38f9..3da8b0d 100644 --- a/src/Propellor/Property/Chroot.hs +++ b/src/Propellor/Property/Chroot.hs @@ -137,7 +137,7 @@ chain hostlist (ChrootChain hn loc systemdonly onconsole) = changeWorkingDirectory localdir when onconsole forceConsole onlyProcess (provisioningLock loc) $ do - r <- runPropellor h $ ensurePropertiesWith ensureProperty' $ + r <- runPropellor h $ ensureProperties $ if systemdonly then [Systemd.installed] else hostProperties h diff --git a/src/Propellor/Property/Docker.hs b/src/Propellor/Property/Docker.hs index 7a06603..02bda2e 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -456,7 +456,7 @@ chain hostlist hn s = case toContainerId s of go cid h = do changeWorkingDirectory localdir onlyProcess (provisioningLock cid) $ do - r <- runPropellor h $ ensurePropertiesWith ensureProperty' $ + r <- runPropellor h $ ensureProperties $ hostProperties h putStrLn $ "\n" ++ show r