From 5a932c382d4cbe65957eb0d3ebe4a9319d8dfd14 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 7 Dec 2014 16:37:02 -0400 Subject: docuemnt info propigtion problem --- src/Propellor/Engine.hs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/Propellor/Engine.hs') diff --git a/src/Propellor/Engine.hs b/src/Propellor/Engine.hs index 44b10cab..aa2ea4a3 100644 --- a/src/Propellor/Engine.hs +++ b/src/Propellor/Engine.hs @@ -52,6 +52,15 @@ runEndAction host res (EndAction desc a) = actionMessageOn (hostName host) desc (ret, _s, _) <- runRWST (runWithHost (catchPropellor (a res))) host () return ret +-- | 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. +ensureProperty :: Property -> Propellor Result +ensureProperty = catchPropellor . propertySatisfy + -- | Ensures a list of Properties, with a display of each as it runs. ensureProperties :: [Property] -> Propellor Result ensureProperties ps = ensure ps NoChange @@ -62,11 +71,6 @@ ensureProperties ps = ensure ps NoChange r <- actionMessageOn hn (propertyDesc l) (ensureProperty l) ensure ls (r <> rs) --- | For when code running in the Propellor monad needs to ensure a --- Property. -ensureProperty :: Property -> Propellor Result -ensureProperty = catchPropellor . propertySatisfy - -- | Lifts an action into a different host. -- -- For example, `fromHost hosts "otherhost" getSshPubKey` -- cgit v1.2.3