From 58c8d74b4c4917f9f5e566709202ad432a7b2a6f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 31 May 2014 20:48:23 -0400 Subject: simplified record accessors --- src/Propellor/Property/Dns.hs | 6 +++--- src/Propellor/Property/Docker.hs | 2 +- src/Propellor/Property/Hostname.hs | 2 +- src/Propellor/Property/Postfix.hs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Propellor/Property') diff --git a/src/Propellor/Property/Dns.hs b/src/Propellor/Property/Dns.hs index 44378491..3e5c7828 100644 --- a/src/Propellor/Property/Dns.hs +++ b/src/Propellor/Property/Dns.hs @@ -352,11 +352,11 @@ genZone hosts zdomain soa = -- so warn. hostips :: Host -> [Either WarningMessage (BindDomain, Record)] hostips h - | null l = [Left $ "no IP address defined for host " ++ _hostName h] + | null l = [Left $ "no IP address defined for host " ++ hostName h] | otherwise = map Right l where attr = hostAttr h - l = zip (repeat $ AbsDomain $ _hostName h) + l = zip (repeat $ AbsDomain $ hostName h) (map Address $ getAddresses attr) -- Any host, whether its hostname is in the zdomain or not, @@ -387,7 +387,7 @@ genZone hosts zdomain soa = hostrecords h = map Right l where attr = hostAttr h - l = zip (repeat $ AbsDomain $ _hostName h) + l = zip (repeat $ AbsDomain $ hostName h) (S.toList $ S.filter (\r -> isNothing (getIPAddr r) && isNothing (getCNAME r)) (_dns attr)) inDomain :: Domain -> BindDomain -> Bool diff --git a/src/Propellor/Property/Docker.hs b/src/Propellor/Property/Docker.hs index 3e925bb6..8e081ae4 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -72,7 +72,7 @@ docked hosts cn = RevertableProperty (go "undocked" teardown) where go desc a = property (desc ++ " " ++ cn) $ do - hn <- getHostName + hn <- asks hostName let cid = ContainerId hn cn ensureProperties [findContainer mhost cid cn $ a cid] diff --git a/src/Propellor/Property/Hostname.hs b/src/Propellor/Property/Hostname.hs index 3859649e..3a6283cf 100644 --- a/src/Propellor/Property/Hostname.hs +++ b/src/Propellor/Property/Hostname.hs @@ -9,7 +9,7 @@ import qualified Propellor.Property.File as File -- A FQDN also configures /etc/hosts, with an entry for 127.0.1.1, which is -- standard at least on Debian to set the FDQN (127.0.0.1 is localhost). sane :: Property -sane = property ("sane hostname") (ensureProperty . setTo =<< getHostName) +sane = property ("sane hostname") (ensureProperty . setTo =<< asks hostName) setTo :: HostName -> Property setTo hn = combineProperties desc go diff --git a/src/Propellor/Property/Postfix.hs b/src/Propellor/Property/Postfix.hs index 9fa4a2c3..ef96e086 100644 --- a/src/Propellor/Property/Postfix.hs +++ b/src/Propellor/Property/Postfix.hs @@ -16,7 +16,7 @@ satellite :: Property satellite = setup `requires` installed where setup = trivial $ property "postfix satellite system" $ do - hn <- getHostName + hn <- asks hostName ensureProperty $ Apt.reConfigure "postfix" [ ("postfix/main_mailer_type", "select", "Satellite system") , ("postfix/root_address", "string", "root") -- cgit v1.2.3