summaryrefslogtreecommitdiff
path: root/src/Propellor/Types
diff options
context:
space:
mode:
authorJoey Hess2014-06-09 01:45:58 -0400
committerJoey Hess2014-06-09 01:47:11 -0400
commitfc49d75e4fb9e8d2c7ce9d60647a26ecc030d253 (patch)
tree1652c818d61150ca718986df6474158c9717c5e1 /src/Propellor/Types
parent582be8ebe00838509d978091d3c97ebeb1bf99de (diff)
Attr is renamed to Info.
Diffstat (limited to 'src/Propellor/Types')
-rw-r--r--src/Propellor/Types/Info.hs (renamed from src/Propellor/Types/Attr.hs)28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/Propellor/Types/Attr.hs b/src/Propellor/Types/Info.hs
index 4389a4e5..5f034492 100644
--- a/src/Propellor/Types/Attr.hs
+++ b/src/Propellor/Types/Info.hs
@@ -1,4 +1,4 @@
-module Propellor.Types.Attr where
+module Propellor.Types.Info where
import Propellor.Types.OS
import qualified Propellor.Types.Dns as Dns
@@ -6,24 +6,24 @@ import qualified Propellor.Types.Dns as Dns
import qualified Data.Set as S
import Data.Monoid
--- | The attributes of a host.
-data Attr = Attr
+-- | Information about a host.
+data Info = Info
{ _os :: Val System
, _sshPubKey :: Val String
, _dns :: S.Set Dns.Record
, _namedconf :: Dns.NamedConfMap
- , _dockerattr :: DockerAttr
+ , _dockerinfo :: DockerInfo
}
deriving (Eq, Show)
-instance Monoid Attr where
- mempty = Attr mempty mempty mempty mempty mempty
- mappend old new = Attr
+instance Monoid Info where
+ mempty = Info mempty mempty mempty mempty mempty
+ mappend old new = Info
{ _os = _os old <> _os new
, _sshPubKey = _sshPubKey old <> _sshPubKey new
, _dns = _dns old <> _dns new
, _namedconf = _namedconf old <> _namedconf new
- , _dockerattr = _dockerattr old <> _dockerattr new
+ , _dockerinfo = _dockerinfo old <> _dockerinfo new
}
data Val a = Val a | NoVal
@@ -39,26 +39,26 @@ fromVal :: Val a -> Maybe a
fromVal (Val a) = Just a
fromVal NoVal = Nothing
-data DockerAttr = DockerAttr
+data DockerInfo = DockerInfo
{ _dockerImage :: Val String
, _dockerRunParams :: [HostName -> String]
}
-instance Eq DockerAttr where
+instance Eq DockerInfo where
x == y = and
[ _dockerImage x == _dockerImage y
, let simpl v = map (\a -> a "") (_dockerRunParams v)
in simpl x == simpl y
]
-instance Monoid DockerAttr where
- mempty = DockerAttr mempty mempty
- mappend old new = DockerAttr
+instance Monoid DockerInfo where
+ mempty = DockerInfo mempty mempty
+ mappend old new = DockerInfo
{ _dockerImage = _dockerImage old <> _dockerImage new
, _dockerRunParams = _dockerRunParams old <> _dockerRunParams new
}
-instance Show DockerAttr where
+instance Show DockerInfo where
show a = unlines
[ "docker image " ++ show (_dockerImage a)
, "docker run params " ++ show (map (\mk -> mk "") (_dockerRunParams a))