diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-01-18 18:02:07 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-01-18 18:46:38 -0400 |
| commit | afee550e708cb50a72f0505e3c4ca8f775f39ef0 (patch) | |
| tree | 923be3a07f86c7cf30c20152922e7513d7fe0057 /src/Propellor/Info.hs | |
| parent | fcd8a3171b4fece8400f7e0b6796d6918b1aec43 (diff) | |
Property tree
Properties now form a tree, instead of the flat list used before.
This simplifies propigation of Info from the Properties used inside a
container to the outer host; the Property that docks the container on the
host can just have as child properties all the inner Properties, and their
Info can then be gathered recursively. (Although in practice it still needs
to be filtered, since not all Info should propigate out of a container.)
Note that there is no change to how Properties are actually satisfied.
Just because a Property lists some child properties, this does not mean
they always have their propertySatisfy actions run. It's still up to the
parent property to run those actions.
That's necessary so that a container's properties can be satisfied inside
it, not outside. It also allows property combinators to
add the combined Properties to their childProperties list, even if,
like onChange, they don't always run the child properties at all.
Testing: I tested that the exact same Info is calculated before and after
this change, for every Host in my config file.
Diffstat (limited to 'src/Propellor/Info.hs')
| -rw-r--r-- | src/Propellor/Info.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Propellor/Info.hs b/src/Propellor/Info.hs index ccb27cf3..15ea9466 100644 --- a/src/Propellor/Info.hs +++ b/src/Propellor/Info.hs @@ -12,7 +12,7 @@ import Data.Monoid import Control.Applicative pureInfoProperty :: Desc -> Info -> Property -pureInfoProperty desc = Property ("has " ++ desc) (return NoChange) +pureInfoProperty desc i = Property ("has " ++ desc) (return NoChange) i mempty askInfo :: (Info -> Val a) -> Propellor (Maybe a) askInfo f = asks (fromVal . f . hostInfo) |
