diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-10-16 15:36:24 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-10-16 15:36:24 -0400 |
| commit | 06f4258f8174302a825a893b3407df9cff15c577 (patch) | |
| tree | 9673a75b78716852425e417a1d8519de2d8b20ca /src/Propellor/Property/Uwsgi.hs | |
| parent | f3a4b1a1beab90e2c630465811ce4a198ad7ba0f (diff) | |
| parent | 7f7249f801653e0bd7fa083ed001bf3c5a3c3900 (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Property/Uwsgi.hs')
| -rw-r--r-- | src/Propellor/Property/Uwsgi.hs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/Propellor/Property/Uwsgi.hs b/src/Propellor/Property/Uwsgi.hs index 8beea17a..7de1a85a 100644 --- a/src/Propellor/Property/Uwsgi.hs +++ b/src/Propellor/Property/Uwsgi.hs @@ -6,7 +6,6 @@ import Propellor.Base import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Service as Service -import System.Posix.Files type ConfigFile = [String] @@ -15,17 +14,11 @@ type AppName = String appEnabled :: AppName -> ConfigFile -> RevertableProperty appEnabled an cf = enable <!> disable where - enable = check test prop + enable = appVal an `File.isSymlinkedTo` appValRelativeCfg an `describe` ("uwsgi app enabled " ++ an) `requires` appAvailable an cf `requires` installed `onChange` reloaded - where - test = not <$> doesFileExist (appVal an) - prop = property "uwsgi app in place" $ makeChange $ - createSymbolicLink target dir - target = appValRelativeCfg an - dir = appVal an disable = trivial $ File.notPresent (appVal an) `describe` ("uwsgi app disable" ++ an) `requires` installed @@ -43,8 +36,8 @@ appCfg an = "/etc/uwsgi/apps-available/" ++ an appVal :: AppName -> FilePath appVal an = "/etc/uwsgi/apps-enabled/" ++ an -appValRelativeCfg :: AppName -> FilePath -appValRelativeCfg an = "../apps-available/" ++ an +appValRelativeCfg :: AppName -> File.LinkTarget +appValRelativeCfg an = File.LinkTarget $ "../apps-available/" ++ an installed :: Property NoInfo installed = Apt.installed ["uwsgi"] |
