diff options
| author | Joey Hess <joey@kitenet.net> | 2014-05-31 17:22:35 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-05-31 17:22:35 -0400 |
| commit | c742c2eb1b7141fbe0628870e899d3461a88686a (patch) | |
| tree | 517abf211851134fb11150393d3817165a1c7a67 /src/Propellor/Attr.hs | |
| parent | 6383d8c38893c160382eb9bf69e0315c5e87269e (diff) | |
propellor spin
Diffstat (limited to 'src/Propellor/Attr.hs')
| -rw-r--r-- | src/Propellor/Attr.hs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/Propellor/Attr.hs b/src/Propellor/Attr.hs index e2b64bf0..6bc4fcf1 100644 --- a/src/Propellor/Attr.hs +++ b/src/Propellor/Attr.hs @@ -83,22 +83,17 @@ sshPubKey k = pureAttrProperty ("ssh pubkey known") $ getSshPubKey :: Propellor (Maybe String) getSshPubKey = asks _sshPubKey -hostnameless :: Attr -hostnameless = newAttr (error "hostname Attr not specified") - hostAttr :: Host -> Attr -hostAttr (Host _ mkattrs) = mkattrs hostnameless +hostAttr (Host hn _ mkattrs) = mkattrs (newAttr hn) hostProperties :: Host -> [Property] -hostProperties (Host ps _) = ps +hostProperties (Host _ ps _) = ps hostMap :: [Host] -> M.Map HostName Host -hostMap l = M.fromList $ zip (map (_hostname . hostAttr) l) l +hostMap l = M.fromList $ zip (map _hostName l) l hostAttrMap :: [Host] -> M.Map HostName Attr -hostAttrMap l = M.fromList $ zip (map _hostname attrs) attrs - where - attrs = map hostAttr l +hostAttrMap l = M.fromList $ zip (map _hostName l) (map hostAttr l) findHost :: [Host] -> HostName -> Maybe Host findHost l hn = M.lookup hn (hostMap l) |
