From 12548bae3d8feecce6a322162d91b827289ae824 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 5 Dec 2015 17:52:43 -0400 Subject: UncheckedProperty for cmdProperty et al * Properties that run an arbitrary command, such as cmdProperty and scriptProperty are converted to use UncheckedProperty, since they cannot tell on their own if the command truely made a change or not. (API Change) Transition guide: - When GHC complains about an UncheckedProperty, add: `assume` MadeChange - Since these properties used to always return MadeChange, that change is always safe to make. - Or, if you know that the command should modifiy a file, use: `changesFile` filename * A few properties have had their Result improved, for example Apt.buldDep and Apt.autoRemove now check if a change was made or not. --- src/Propellor/Property/Apache.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Propellor/Property/Apache.hs') diff --git a/src/Propellor/Property/Apache.hs b/src/Propellor/Property/Apache.hs index c2f49cff..626d3879 100644 --- a/src/Propellor/Property/Apache.hs +++ b/src/Propellor/Property/Apache.hs @@ -39,6 +39,7 @@ siteEnabled hn cf = enable disable `onChange` reloaded , check (not <$> isenabled) $ cmdProperty "a2ensite" ["--quiet", hn] + `assume` MadeChange `requires` installed `onChange` reloaded ] @@ -49,7 +50,7 @@ siteDisabled :: HostName -> Property NoInfo siteDisabled hn = combineProperties ("apache site disabled " ++ hn) (map File.notPresent (siteCfg hn)) - `onChange` cmdProperty "a2dissite" ["--quiet", hn] + `onChange` (cmdProperty "a2dissite" ["--quiet", hn] `assume` MadeChange) `requires` installed `onChange` reloaded @@ -64,11 +65,13 @@ modEnabled modname = enable disable where enable = check (not <$> isenabled) $ cmdProperty "a2enmod" ["--quiet", modname] + `assume` MadeChange `describe` ("apache module enabled " ++ modname) `requires` installed `onChange` reloaded disable = check isenabled $ cmdProperty "a2dismod" ["--quiet", modname] + `assume` MadeChange `describe` ("apache module disabled " ++ modname) `requires` installed `onChange` reloaded -- cgit v1.3-2-g0d8e