summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Docker.hs
diff options
context:
space:
mode:
authorJoey Hess2017-02-26 15:27:22 -0400
committerJoey Hess2017-02-26 16:08:04 -0400
commit2ba4b6fb3d29b2b65aa60f4bd591ed8cf6a63e27 (patch)
tree873d0e3cd1582e68aa080ec032833f6a9a890407 /src/Propellor/Property/Docker.hs
parentd19bdf24ccce2556cf462d74335a8f131448da95 (diff)
Added ConfigurableValue type class
* Added ConfigurableValue type class, for values that can be used in a config file, or to otherwise configure a program. * The val function converts such values to String. This was motivated by the bug caused by type Port = Int changing to newtype Port = Port Int deriving Show After that change, some things that used show port to generate config files were broken. By using the ConfigurableValue type class instead, such breakage can be prevented.
Diffstat (limited to 'src/Propellor/Property/Docker.hs')
-rw-r--r--src/Propellor/Property/Docker.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Propellor/Property/Docker.hs b/src/Propellor/Property/Docker.hs
index 0bfcc781..68fa2926 100644
--- a/src/Propellor/Property/Docker.hs
+++ b/src/Propellor/Property/Docker.hs
@@ -660,10 +660,10 @@ listImages :: IO [ImageUID]
listImages = map ImageUID . lines <$> readProcess dockercmd ["images", "--all", "--quiet"]
runProp :: String -> RunParam -> Property (HasInfo + Linux)
-runProp field val = tightenTargets $ pureInfoProperty (param) $
+runProp field v = tightenTargets $ pureInfoProperty (param) $
mempty { _dockerRunParams = [DockerRunParam (\_ -> "--"++param)] }
where
- param = field++"="++val
+ param = field++"="++v
genProp :: String -> (HostName -> RunParam) -> Property (HasInfo + Linux)
genProp field mkval = tightenTargets $ pureInfoProperty field $