diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-09-06 08:19:02 -0700 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-09-06 16:13:54 -0400 |
| commit | def53b64cc17b95eb5729dd97a800dfe1257b352 (patch) | |
| tree | 03f63e5bcb6486b00639e1ea78c21d8928c3b8ca /src/Propellor/Property/Chroot.hs | |
| parent | 6f4024f5307a81f26f5e6bf86b84c7363219cb3d (diff) | |
Added Propellor.Property.Rsync. WIP; untested
Convert Info to use Data.Dynamic, so properties can export and consume
info of any type that is Typeable and a Monoid, including data types
private to a module. (API change)
Thanks to Joachim Breitner for the idea.
Diffstat (limited to 'src/Propellor/Property/Chroot.hs')
| -rw-r--r-- | src/Propellor/Property/Chroot.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs index ded108bc..0cbc8642 100644 --- a/src/Propellor/Property/Chroot.hs +++ b/src/Propellor/Property/Chroot.hs @@ -15,6 +15,7 @@ module Propellor.Property.Chroot ( import Propellor import Propellor.Types.CmdLine import Propellor.Types.Chroot +import Propellor.Types.Info import Propellor.Property.Chroot.Util import qualified Propellor.Property.Debootstrap as Debootstrap import qualified Propellor.Property.Systemd.Core as Systemd @@ -91,8 +92,8 @@ propigateChrootInfo c p = propigateContainer c p' (propertyChildren p) chrootInfo :: Chroot -> Info -chrootInfo (Chroot loc _ _ h) = - mempty { _chrootinfo = mempty { _chroots = M.singleton loc h } } +chrootInfo (Chroot loc _ _ h) = mempty `addInfo` + mempty { _chroots = M.singleton loc h } -- | Propellor is run inside the chroot to provision it. propellChroot :: Chroot -> ([String] -> IO (CreateProcess, IO ())) -> Bool -> Property NoInfo @@ -143,7 +144,7 @@ chain :: [Host] -> CmdLine -> IO () chain hostlist (ChrootChain hn loc systemdonly onconsole) = case findHostNoAlias hostlist hn of Nothing -> errorMessage ("cannot find host " ++ hn) - Just parenthost -> case M.lookup loc (_chroots $ _chrootinfo $ hostInfo parenthost) of + Just parenthost -> case M.lookup loc (_chroots $ getInfo $ hostInfo parenthost) of Nothing -> errorMessage ("cannot find chroot " ++ loc ++ " on host " ++ hn) Just h -> go h where |
