From ca5f973c2b745b75da57d4b3953d50604165fcd0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 20 Sep 2015 14:37:41 -0400 Subject: reformat and fix warning about 2 definitions of 'u' --- src/Propellor/Property/Aiccu.hs | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'src/Propellor') 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 -- cgit v1.2.3