From 6b9f3158df63e18b32b7175205ef686badc3bc1b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 25 Mar 2016 16:12:27 -0400 Subject: ported mainProperties --- src/Propellor/Engine.hs | 15 ++++++--------- src/Propellor/PropAccum.hs | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/Propellor/Engine.hs b/src/Propellor/Engine.hs index 62fad5af..bf49b95f 100644 --- a/src/Propellor/Engine.hs +++ b/src/Propellor/Engine.hs @@ -1,8 +1,8 @@ {-# LANGUAGE PackageImports #-} -{-# LANGUAGE GADTs #-} +{-# LANGUAGE DataKinds #-} module Propellor.Engine ( - -- mainProperties, + mainProperties, runPropellor, ensureProperty, ensureChildProperties, @@ -29,22 +29,19 @@ import Propellor.Info import Propellor.Property import Utility.Exception -{- - -- | Gets the Properties of a Host, and ensures them all, -- with nice display of what's being done. mainProperties :: Host -> IO () mainProperties host = do - ret <- runPropellor host $ - ensureProperties [ignoreInfo $ infoProperty "overall" (ensureProperties ps) mempty mempty] + ret <- runPropellor host $ ensureChildProperties [toProp overall] messagesDone case ret of FailedChange -> exitWith (ExitFailure 1) _ -> exitWith ExitSuccess where - ps = map ignoreInfo $ hostProperties host - --} + overall :: Property (MetaTypes '[]) + overall = property "overall" $ + ensureChildProperties (hostProperties host) -- | Runs a Propellor action with the specified host. -- diff --git a/src/Propellor/PropAccum.hs b/src/Propellor/PropAccum.hs index 91d7b80d..06b8ad3f 100644 --- a/src/Propellor/PropAccum.hs +++ b/src/Propellor/PropAccum.hs @@ -30,7 +30,7 @@ import Propellor.PrivData -- > ! oldproperty -- > & otherproperty host :: HostName -> Props metatypes -> Host -host hn (Props c) = Host hn c (mconcat (map getInfoRecursive c)) +host hn (Props ps) = Host hn ps (mconcat (map getInfoRecursive ps)) -- | Props is a combination of a list of properties, with their combined -- metatypes. -- cgit v1.2.3