diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-09-20 14:37:41 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-09-20 14:37:41 -0400 |
| commit | ca5f973c2b745b75da57d4b3953d50604165fcd0 (patch) | |
| tree | 56fca4d8636cf16795181af4dae8dd71acff921d /src | |
| parent | 266fbe7f20dbefc4709b323bc316f4ae33206ec6 (diff) | |
reformat and fix warning about 2 definitions of 'u'
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Aiccu.hs | 32 |
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 |
