summaryrefslogtreecommitdiff
path: root/src/Propellor/Property
diff options
context:
space:
mode:
authorJoey Hess2017-02-26 16:48:26 -0400
committerJoey Hess2017-02-26 16:48:26 -0400
commitaa225472fb586486b5839e5362a555a476e9a45d (patch)
treec032200efff9476e2c34bcef40b228524b6631ed /src/Propellor/Property
parentae7359a0b0cf58ec83a7ea80fc51d4e6f5be72bf (diff)
convert fromIPAddr to val
Diffstat (limited to 'src/Propellor/Property')
-rw-r--r--src/Propellor/Property/Dns.hs2
-rw-r--r--src/Propellor/Property/Firewall.hs8
-rw-r--r--src/Propellor/Property/Munin.hs2
-rw-r--r--src/Propellor/Property/Unbound.hs2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/Propellor/Property/Dns.hs b/src/Propellor/Property/Dns.hs
index 3fcffed3..889aece5 100644
--- a/src/Propellor/Property/Dns.hs
+++ b/src/Propellor/Property/Dns.hs
@@ -250,7 +250,7 @@ confStanza c =
cfgline f v = "\t" ++ f ++ " " ++ v ++ ";"
ipblock name l =
[ "\t" ++ name ++ " {" ] ++
- (map (\ip -> "\t\t" ++ fromIPAddr ip ++ ";") l) ++
+ (map (\ip -> "\t\t" ++ val ip ++ ";") l) ++
[ "\t};" ]
mastersblock
| null (confMasters c) = []
diff --git a/src/Propellor/Property/Firewall.hs b/src/Propellor/Property/Firewall.hs
index ab667da3..736a4458 100644
--- a/src/Propellor/Property/Firewall.hs
+++ b/src/Propellor/Property/Firewall.hs
@@ -99,7 +99,7 @@ toIpTableArg (NotDestination ipwm) =
]
toIpTableArg (NatDestination ip mport) =
[ "--to-destination"
- , fromIPAddr ip ++ maybe "" (\p -> ":" ++ val p) mport
+ , val ip ++ maybe "" (\p -> ":" ++ val p) mport
]
toIpTableArg (r :- r') = toIpTableArg r <> toIpTableArg r'
@@ -107,9 +107,9 @@ data IPWithMask = IPWithNoMask IPAddr | IPWithIPMask IPAddr IPAddr | IPWithNumMa
deriving (Eq, Show)
instance ConfigurableValue IPWithMask where
- val (IPWithNoMask ip) = fromIPAddr ip
- val (IPWithIPMask ip ipm) = fromIPAddr ip ++ "/" ++ fromIPAddr ipm
- val (IPWithNumMask ip m) = fromIPAddr ip ++ "/" ++ show m
+ val (IPWithNoMask ip) = val ip
+ val (IPWithIPMask ip ipm) = val ip ++ "/" ++ val ipm
+ val (IPWithNumMask ip m) = val ip ++ "/" ++ val m
data Rule = Rule
{ ruleChain :: Chain
diff --git a/src/Propellor/Property/Munin.hs b/src/Propellor/Property/Munin.hs
index 13c72f3a..6dab25ef 100644
--- a/src/Propellor/Property/Munin.hs
+++ b/src/Propellor/Property/Munin.hs
@@ -46,7 +46,7 @@ hostListFragment' hs os = concatMap muninHost hs
where
muninHost :: Host -> [String]
muninHost h = [ "[" ++ (hostName h) ++ "]"
- , " address " ++ maybe (hostName h) (fromIPAddr . fst) (hOverride h)
+ , " address " ++ maybe (hostName h) (val . fst) (hOverride h)
] ++ (maybe [] (\x -> [" port " ++ (val $ snd x)]) (hOverride h)) ++ [""]
hOverride :: Host -> Maybe (IPAddr, Port)
hOverride h = lookup (hostName h) os
diff --git a/src/Propellor/Property/Unbound.hs b/src/Propellor/Property/Unbound.hs
index 9eb8f8c9..470aad7e 100644
--- a/src/Propellor/Property/Unbound.hs
+++ b/src/Propellor/Property/Unbound.hs
@@ -133,7 +133,7 @@ genAddress dom ttl addr = case addr of
IPv6 _ -> genAddress' "AAAA" dom ttl addr
genAddress' :: String -> BindDomain -> Maybe Int -> IPAddr -> String
-genAddress' recordtype dom ttl addr = dValue dom ++ " " ++ maybe "" (\ttl' -> val ttl' ++ " ") ttl ++ "IN " ++ recordtype ++ " " ++ fromIPAddr addr
+genAddress' recordtype dom ttl addr = dValue dom ++ " " ++ maybe "" (\ttl' -> val ttl' ++ " ") ttl ++ "IN " ++ recordtype ++ " " ++ val addr
genMX :: BindDomain -> Int -> BindDomain -> String
genMX dom priority dest = dValue dom ++ " " ++ "MX" ++ " " ++ val priority ++ " " ++ dValue dest