diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-03-25 16:12:27 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-03-25 16:12:27 -0400 |
| commit | 6b9f3158df63e18b32b7175205ef686badc3bc1b (patch) | |
| tree | e169e77f1eb0c5f07cef7a441410af2f6053a857 /src/Propellor | |
| parent | 4694a4c36cca1c7b52421297a62548d8bbb2ec0b (diff) | |
ported mainProperties
Diffstat (limited to 'src/Propellor')
| -rw-r--r-- | src/Propellor/Engine.hs | 15 | ||||
| -rw-r--r-- | src/Propellor/PropAccum.hs | 2 |
2 files changed, 7 insertions, 10 deletions
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. |
