summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Unbound.hs
diff options
context:
space:
mode:
authorJoey Hess2015-09-14 15:03:42 -0400
committerJoey Hess2015-09-14 15:03:42 -0400
commit115baccc7761356ec6633202e69dfff65f53a993 (patch)
treedd1bb9febcc886171117582f65bb268f8c8e9b11 /src/Propellor/Property/Unbound.hs
parent91cb7739968a687ca7922369b2271dc429dbdb9d (diff)
add missing import and minor cleanup
Diffstat (limited to 'src/Propellor/Property/Unbound.hs')
-rw-r--r--src/Propellor/Property/Unbound.hs8
1 files changed, 4 insertions, 4 deletions
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