From 115baccc7761356ec6633202e69dfff65f53a993 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 14 Sep 2015 15:03:42 -0400 Subject: add missing import and minor cleanup --- src/Propellor/Property/Unbound.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Propellor/Property') diff --git a/src/Propellor/Property/Unbound.hs b/src/Propellor/Property/Unbound.hs index 39691482..950f669e 100644 --- a/src/Propellor/Property/Unbound.hs +++ b/src/Propellor/Property/Unbound.hs @@ -12,10 +12,11 @@ module Propellor.Property.Unbound , canonical , genZoneStatic , genZoneTransparent -) where + ) where import Propellor import qualified Propellor.Property.Apt as Apt +import qualified Propellor.Property.Service as Service import Data.List import Data.String.Utils (split, replace) @@ -53,9 +54,8 @@ genPTR :: BindDomain -> IPAddr -> String genPTR dom ip = localData $ revIP ip ++ ". " ++ "PTR" ++ " " ++ dValue dom revIP :: IPAddr -> String -revIP addr = case addr of - IPv4 addr' -> intercalate "." (reverse $ split "." addr') ++ ".in-addr.arpa" - IPv6 _ -> reverse (intersperse '.' $ replace ":" "" $ fromIPAddr $ canonical addr) ++ ".ip6.arpa" +revIP (IPv4 addr) = intercalate "." (reverse $ split "." addr) ++ ".in-addr.arpa" +revIP addr@(IPv6 _) = reverse (intersperse '.' $ replace ":" "" $ fromIPAddr $ canonical addr) ++ ".ip6.arpa" canonical :: IPAddr -> IPAddr canonical (IPv4 addr) = IPv4 addr -- cgit v1.2.3