From 52ca81661f156122a3a5d4a438fea83e067215ac Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 15 Mar 2017 14:09:07 -0400 Subject: Property types changed to use a Maybe (Propellor Result). (API change) * Property types changed to use a Maybe (Propellor Result). (API change) * When Nothing needs to be done to ensure a property, propellor will avoid displaying its description at all. The doNothing property is an example of such a property. This is mostly in preparation for Monoid instances for Property types, but is's also nice that anything that uses doNothing will avoid printing out any message at all. At least, I think it probably is. It might potentially be confusing for something that sometimes takes an action and sometimes resolves to doNothing and in either case has a description set to not always show the description. If this did turn out to be confusing, the change to doNothing could be reverted. This commit was sponsored by Boyd Stephen Smith Jr. on Patreon. --- src/Propellor/Engine.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Propellor/Engine.hs') diff --git a/src/Propellor/Engine.hs b/src/Propellor/Engine.hs index 8958da6b..08f535e0 100644 --- a/src/Propellor/Engine.hs +++ b/src/Propellor/Engine.hs @@ -66,7 +66,9 @@ ensureChildProperties ps = ensure ps NoChange ensure [] rs = return rs ensure (p:ls) rs = do hn <- asks hostName - r <- actionMessageOn hn (getDesc p) (catchPropellor $ getSatisfy p) + r <- maybe (pure NoChange) + (actionMessageOn hn (getDesc p) . catchPropellor) + (getSatisfy p) ensure ls (r <> rs) -- | Lifts an action into the context of a different host. -- cgit v1.3-2-g0d8e