From 414ee7eee60300eb7f7c49e4890b056d19b3c59b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Jan 2015 13:59:29 -0400 Subject: added GADT to determine between a property with info and without Not yet used --- src/Propellor/Property/Chroot.hs | 6 +++++- src/Propellor/Property/Dns.hs | 2 +- src/Propellor/Property/Docker.hs | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/Propellor/Property') diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs index e8afb656..0ef6e7dd 100644 --- a/src/Propellor/Property/Chroot.hs +++ b/src/Propellor/Property/Chroot.hs @@ -80,7 +80,11 @@ provisioned' propigator c@(Chroot loc system builderconf _) systemdonly = Revert propigateChrootInfo :: Chroot -> Property -> Property propigateChrootInfo c p = propigateContainer c p' where - p' = p { propertyInfo = propertyInfo p <> chrootInfo c } + p' = mkProperty + (propertyDesc p) + (propertySatisfy p) + (propertyInfo p <> chrootInfo c) + (propertyChildren p) chrootInfo :: Chroot -> Info chrootInfo (Chroot loc _ _ h) = diff --git a/src/Propellor/Property/Dns.hs b/src/Propellor/Property/Dns.hs index 6114834c..d6666618 100644 --- a/src/Propellor/Property/Dns.hs +++ b/src/Propellor/Property/Dns.hs @@ -77,7 +77,7 @@ setupPrimary zonefile mknamedconffile hosts domain soa rs = indomain = M.elems $ M.filterWithKey (\hn _ -> inDomain domain $ AbsDomain $ hn) hostmap (partialzone, zonewarnings) = genZone indomain hostmap domain soa - baseprop = Property ("dns primary for " ++ domain) satisfy + baseprop = mkProperty ("dns primary for " ++ domain) satisfy (addNamedConf conf) [] satisfy = do sshfps <- concat <$> mapM (genSSHFP domain) (M.elems hostmap) diff --git a/src/Propellor/Property/Docker.hs b/src/Propellor/Property/Docker.hs index b641c89c..9645bfe7 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -137,7 +137,11 @@ docked ctr@(Container _ h) = RevertableProperty propigateContainerInfo :: Container -> Property -> Property propigateContainerInfo ctr@(Container _ h) p = propigateContainer ctr p' where - p' = p { propertyInfo = propertyInfo p <> dockerinfo } + p' = mkProperty + (propertyDesc p) + (propertySatisfy p) + (propertyInfo p <> dockerinfo) + (propertyChildren p) dockerinfo = dockerInfo $ mempty { _dockerContainers = M.singleton (hostName h) h } -- cgit v1.3-2-g0d8e