From 73a75cbefc242133b921fe7314e596ea12bdfbea Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 12:11:07 -0400 Subject: Fix loop when a docker host that does not exist was docked. The problem is it fell back to looking for an alias for the bad hostname, but to get the aliases, it needs to know which hosts are docked where, so looped. --- src/Propellor/Info.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Propellor/Info.hs') diff --git a/src/Propellor/Info.hs b/src/Propellor/Info.hs index 1b89c008..f44d1de3 100644 --- a/src/Propellor/Info.hs +++ b/src/Propellor/Info.hs @@ -80,7 +80,10 @@ aliasMap = M.fromList . concat . map (\h -> map (\aka -> (aka, h)) $ S.toList $ _aliases $ hostInfo h) findHost :: [Host] -> HostName -> Maybe Host -findHost l hn = maybe (findAlias l hn) Just (M.lookup hn (hostMap l)) +findHost l hn = maybe (findAlias l hn) Just (findHostNoAlias l hn) + +findHostNoAlias :: [Host] -> HostName -> Maybe Host +findHostNoAlias l hn = M.lookup hn (hostMap l) findAlias :: [Host] -> HostName -> Maybe Host findAlias l hn = M.lookup hn (aliasMap l) -- cgit v1.3-2-g0d8e