From 5cfb20668421acb3c0de133afe973fc693b8b320 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 5 Dec 2015 18:03:02 -0400 Subject: remove trivial --- src/Propellor/Property/Apt.hs | 8 ++++---- src/Propellor/Property/Nginx.hs | 2 +- src/Propellor/Property/Postfix.hs | 3 ++- src/Propellor/Property/Prosody.hs | 2 +- src/Propellor/Property/Uwsgi.hs | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src/Propellor/Property') diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs index cf81c9be..26c151d9 100644 --- a/src/Propellor/Property/Apt.hs +++ b/src/Propellor/Property/Apt.hs @@ -140,13 +140,13 @@ installed' params ps = robustly $ check (isInstallable ps) go `assume` MadeChange installedBackport :: [Package] -> Property NoInfo -installedBackport ps = trivial $ withOS desc $ \o -> case o of +installedBackport ps = withOS desc $ \o -> case o of Nothing -> error "cannot install backports; os not declared" (Just (System (Debian suite) _)) -> case backportSuite suite of Nothing -> notsupported o - Just bs -> ensureProperty $ runApt - (["install", "-t", bs, "-y"] ++ ps) - `assume` MadeChange + Just bs -> ensureProperty $ + runApt (["install", "-t", bs, "-y"] ++ ps) + `changesFile` dpkgStatus _ -> notsupported o where desc = (unwords $ "apt installed backport":ps) diff --git a/src/Propellor/Property/Nginx.hs b/src/Propellor/Property/Nginx.hs index c28dcc01..8fb5c49b 100644 --- a/src/Propellor/Property/Nginx.hs +++ b/src/Propellor/Property/Nginx.hs @@ -17,7 +17,7 @@ siteEnabled hn cf = enable disable `requires` siteAvailable hn cf `requires` installed `onChange` reloaded - disable = trivial $ File.notPresent (siteVal hn) + disable = File.notPresent (siteVal hn) `describe` ("nginx site disable" ++ hn) `requires` installed `onChange` reloaded diff --git a/src/Propellor/Property/Postfix.hs b/src/Propellor/Property/Postfix.hs index 782e7f45..bc46ac21 100644 --- a/src/Propellor/Property/Postfix.hs +++ b/src/Propellor/Property/Postfix.hs @@ -32,7 +32,7 @@ satellite :: Property NoInfo satellite = check (not <$> mainCfIsSet "relayhost") setup `requires` installed where - setup = trivial $ property "postfix satellite system" $ do + setup = property "postfix satellite system" $ do hn <- asks hostName let (_, domain) = separate (== '.') hn ensureProperties @@ -181,3 +181,4 @@ saslPasswdSet domain (User user) = withPrivData src ctx $ \getpw -> trivial $ p = proc "saslpasswd2" ps ctx = Context "sasl" src = PrivDataSource (Password uatd) "enter password" + trivial = flip assume NoChange diff --git a/src/Propellor/Property/Prosody.hs b/src/Propellor/Property/Prosody.hs index f2d80ae4..47095504 100644 --- a/src/Propellor/Property/Prosody.hs +++ b/src/Propellor/Property/Prosody.hs @@ -24,7 +24,7 @@ confEnabled conf cf = enable disable dir = confValPath conf confValRelativePath conf' = File.LinkTarget $ "../conf.avail" conf' <.> "cfg.lua" - disable = trivial $ File.notPresent (confValPath conf) + disable = File.notPresent (confValPath conf) `describe` ("prosody conf disabled " ++ conf) `requires` installed `onChange` reloaded diff --git a/src/Propellor/Property/Uwsgi.hs b/src/Propellor/Property/Uwsgi.hs index 9748f16d..8b531c3f 100644 --- a/src/Propellor/Property/Uwsgi.hs +++ b/src/Propellor/Property/Uwsgi.hs @@ -19,7 +19,7 @@ appEnabled an cf = enable disable `requires` appAvailable an cf `requires` installed `onChange` reloaded - disable = trivial $ File.notPresent (appVal an) + disable = File.notPresent (appVal an) `describe` ("uwsgi app disable" ++ an) `requires` installed `onChange` reloaded -- cgit v1.2.3