summaryrefslogtreecommitdiff
path: root/src/Propellor/Attr.hs
diff options
context:
space:
mode:
authorJoey Hess2014-05-31 20:48:23 -0400
committerJoey Hess2014-05-31 20:48:23 -0400
commit58c8d74b4c4917f9f5e566709202ad432a7b2a6f (patch)
tree65da63c631e875a1bf074da920e145d07d011698 /src/Propellor/Attr.hs
parente133536c3f7cc4dd816b8c5fe97e3131411a5ae9 (diff)
simplified record accessors
Diffstat (limited to 'src/Propellor/Attr.hs')
-rw-r--r--src/Propellor/Attr.hs11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/Propellor/Attr.hs b/src/Propellor/Attr.hs
index 8f1c6b7c..29d7a01e 100644
--- a/src/Propellor/Attr.hs
+++ b/src/Propellor/Attr.hs
@@ -15,9 +15,6 @@ import Control.Applicative
pureAttrProperty :: Desc -> Attr -> Property
pureAttrProperty desc = Property ("has " ++ desc) (return NoChange)
-getHostName :: Propellor HostName
-getHostName = asks _hostName
-
os :: System -> Property
os system = pureAttrProperty ("Operating " ++ show system) $
mempty { _os = Just system }
@@ -63,14 +60,8 @@ sshPubKey k = pureAttrProperty ("ssh pubkey known") $
getSshPubKey :: Propellor (Maybe String)
getSshPubKey = asks (_sshPubKey . hostAttr)
-hostAttr :: Host -> Attr
-hostAttr (Host _ _ attr) = attr
-
-hostProperties :: Host -> [Property]
-hostProperties (Host _ ps _) = ps
-
hostMap :: [Host] -> M.Map HostName Host
-hostMap l = M.fromList $ zip (map _hostName l) l
+hostMap l = M.fromList $ zip (map hostName l) l
findHost :: [Host] -> HostName -> Maybe Host
findHost l hn = M.lookup hn (hostMap l)