diff options
| author | Félix Sipma <felix.sipma@no-log.org> | 2015-07-31 12:34:25 +0200 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-07-31 10:31:31 -0400 |
| commit | b7a9655a695103b3ca2e4e6edfe305f9b44d9250 (patch) | |
| tree | 6f28ac50e476e83b212e2827a10d4b6dee0730c9 /src | |
| parent | 6fe4b0cd9174aad50987a41784f2e63cf8f1ddd1 (diff) | |
Propellor.Property.Tor: remove duplicate code
Signed-off-by: Félix Sipma <felix.sipma@no-log.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Tor.hs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/Propellor/Property/Tor.hs b/src/Propellor/Property/Tor.hs index 3af4a70c..f1aaeeb1 100644 --- a/src/Propellor/Property/Tor.hs +++ b/src/Propellor/Property/Tor.hs @@ -103,13 +103,8 @@ bandwidthRate' s divby = case readSize dataUnits s of Nothing -> property ("unable to parse " ++ s) noChange hiddenServiceAvailable :: HiddenServiceName -> Int -> Property NoInfo -hiddenServiceAvailable hn port = hiddenServiceHostName prop +hiddenServiceAvailable hn port = hiddenServiceHostName $ hiddenService hn port where - prop = configured - [ ("HiddenServiceDir", varLib </> hn) - , ("HiddenServicePort", unwords [show port, "127.0.0.1:" ++ show port]) - ] - `describe` "hidden service available" hiddenServiceHostName p = adjustPropertySatisfy p $ \satisfy -> do r <- satisfy h <- liftIO $ readFile (varLib </> hn </> "hostname") @@ -164,7 +159,7 @@ type NickName = String -- | Convert String to a valid tor NickName. saneNickname :: String -> NickName -saneNickname s +saneNickname s | null n = "unnamed" | otherwise = n where |
