summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Aiccu.hs
diff options
context:
space:
mode:
authorJoey Hess2015-09-20 14:37:41 -0400
committerJoey Hess2015-09-20 14:37:41 -0400
commitca5f973c2b745b75da57d4b3953d50604165fcd0 (patch)
tree56fca4d8636cf16795181af4dae8dd71acff921d /src/Propellor/Property/Aiccu.hs
parent266fbe7f20dbefc4709b323bc316f4ae33206ec6 (diff)
reformat and fix warning about 2 definitions of 'u'
Diffstat (limited to 'src/Propellor/Property/Aiccu.hs')
-rw-r--r--src/Propellor/Property/Aiccu.hs32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/Propellor/Property/Aiccu.hs b/src/Propellor/Property/Aiccu.hs
index c6c1569a..e6d4f7fe 100644
--- a/src/Propellor/Property/Aiccu.hs
+++ b/src/Propellor/Property/Aiccu.hs
@@ -7,21 +7,23 @@ confPath :: FilePath
confPath = "/etc/aiccu.conf"
config :: String -> String -> PrivData -> [String]
-config u t p = [ "protocol tic"
- , "server tic.sixxs.net"
- , "username " ++ u
- , "password " ++ (privDataVal p)
- , "ipv6_interface sixxs"
- , "tunnel_id " ++ t
- , "daemonize true"
- , "automatic true"
- , "requiretls true"
- , "makebeats true"
- ]
+config u t p =
+ [ "protocol tic"
+ , "server tic.sixxs.net"
+ , "username " ++ u
+ , "password " ++ (privDataVal p)
+ , "ipv6_interface sixxs"
+ , "tunnel_id " ++ t
+ , "daemonize true"
+ , "automatic true"
+ , "requiretls true"
+ , "makebeats true"
+ ]
hasConfig :: String -> String -> Property HasInfo
hasConfig t u = withSomePrivData [(Password (u++"/"++t)), (Password u)] (Context "aiccu") $ property "aiccu configured" . writeConfig
- where writeConfig :: (((PrivDataField, PrivData) -> Propellor Result) -> Propellor Result) -> Propellor Result
- writeConfig getpassword = getpassword $ go
- go (Password u, p) = makeChange $ writeFile confPath (unlines $ config u t p)
- go (f, _) = error $ "Unexpected type of privdata: " ++ show f
+ where
+ writeConfig :: (((PrivDataField, PrivData) -> Propellor Result) -> Propellor Result) -> Propellor Result
+ writeConfig getpassword = getpassword $ go
+ go (Password u', p) = makeChange $ writeFile confPath (unlines $ config u' t p)
+ go (f, _) = error $ "Unexpected type of privdata: " ++ show f