summaryrefslogtreecommitdiff
path: root/src/Propellor/Types/Docker.hs
diff options
context:
space:
mode:
authorJoey Hess2014-12-07 17:09:55 -0400
committerJoey Hess2014-12-07 17:09:55 -0400
commit42a0c832483296fb111279fc3512a3dfd44f2089 (patch)
tree328c20c8a34e908806d240ec2dd5a02437c8df6b /src/Propellor/Types/Docker.hs
parent5a932c382d4cbe65957eb0d3ebe4a9319d8dfd14 (diff)
Display a warning when ensureProperty is used on a property which has Info and is so prevented from propigating it.
Would much rather a type-based fixed, but this is all I have for now.
Diffstat (limited to 'src/Propellor/Types/Docker.hs')
-rw-r--r--src/Propellor/Types/Docker.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Propellor/Types/Docker.hs b/src/Propellor/Types/Docker.hs
index 42a65923..3eafa59d 100644
--- a/src/Propellor/Types/Docker.hs
+++ b/src/Propellor/Types/Docker.hs
@@ -1,6 +1,7 @@
module Propellor.Types.Docker where
import Propellor.Types.OS
+import Propellor.Types.Empty
import Data.Monoid
import qualified Data.Map as M
@@ -18,6 +19,12 @@ instance Monoid (DockerInfo h) where
, _dockerContainers = M.union (_dockerContainers old) (_dockerContainers new)
}
+instance Empty (DockerInfo h) where
+ isEmpty i = and
+ [ isEmpty (_dockerRunParams i)
+ , isEmpty (_dockerContainers i)
+ ]
+
newtype DockerRunParam = DockerRunParam (HostName -> String)
instance Show DockerRunParam where