summaryrefslogtreecommitdiff
path: root/src/Propellor/PropAccum.hs
diff options
context:
space:
mode:
authorJoey Hess2015-09-30 16:39:38 -0400
committerJoey Hess2015-09-30 16:39:38 -0400
commitbe5d4b6dbc919f0c390b2c4a78ae8b0e348e4933 (patch)
tree1700b8bb3521d067a9e3406cdff86a9fe2890b94 /src/Propellor/PropAccum.hs
parenta1ba3c61249ac0b8b5367b0ed5bc5b1b58974173 (diff)
parentfbc9f293eb4bd545ff4fea9ca87cb97ab74eb4d4 (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/PropAccum.hs')
-rw-r--r--src/Propellor/PropAccum.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Propellor/PropAccum.hs b/src/Propellor/PropAccum.hs
index 4b2a5ddb..dec204a2 100644
--- a/src/Propellor/PropAccum.hs
+++ b/src/Propellor/PropAccum.hs
@@ -14,6 +14,7 @@ import Data.Monoid
import Propellor.Types
import Propellor.Property
import Propellor.Types.Info
+import Propellor.PrivData
-- | Starts accumulating the properties of a Host.
--
@@ -72,12 +73,16 @@ infixl 1 !
--
-- The Info of the propertyChildren is adjusted to only include
-- info that should be propigated out to the Property.
+--
+-- Any PrivInfo that uses HostContext is adjusted to use the name
+-- of the container as its context.
propigateContainer
:: (PropAccum container)
- => container
+ => String
+ -> container
-> Property HasInfo
-> Property HasInfo
-propigateContainer c prop = infoProperty
+propigateContainer containername c prop = infoProperty
(propertyDesc prop)
(propertySatisfy prop)
(propertyInfo prop)
@@ -85,6 +90,7 @@ propigateContainer c prop = infoProperty
where
hostprops = map go $ getProperties c
go p =
- let i = propigatableInfo (propertyInfo p)
+ let i = mapInfo (forceHostContext containername)
+ (propigatableInfo (propertyInfo p))
cs = map go (propertyChildren p)
in infoProperty (propertyDesc p) (propertySatisfy p) i cs