summaryrefslogtreecommitdiff
path: root/src/Propellor/Property
diff options
context:
space:
mode:
authorJoey Hess2015-10-19 12:33:18 -0400
committerJoey Hess2015-10-19 12:33:18 -0400
commitace352cc0aa732d00900122e0ab8552c870f3901 (patch)
tree53e8a1019203a94131592f18e280859108129183 /src/Propellor/Property
parent10286791b63b198de7d0dc3742f8e1d58113d3f1 (diff)
improve Info type using GADT, at nomeata's suggestion
This makes Show Info work, and simplifies the implementation.
Diffstat (limited to 'src/Propellor/Property')
-rw-r--r--src/Propellor/Property/Spin.hs2
-rw-r--r--src/Propellor/Property/Ssh.hs4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/Propellor/Property/Spin.hs b/src/Propellor/Property/Spin.hs
index ead85f59..5f857ef4 100644
--- a/src/Propellor/Property/Spin.hs
+++ b/src/Propellor/Property/Spin.hs
@@ -125,7 +125,7 @@ cdesc n = "controller for " ++ n
-- To detect loops of controlled hosts, each Host's info contains a list
-- of the hosts it's controlling.
newtype Controlling = Controlled [Host]
- deriving (Typeable, Monoid)
+ deriving (Typeable, Monoid, Show)
isControlledBy :: Host -> Controlling -> Bool
h `isControlledBy` (Controlled hs) = any (== hostName h) (map hostName hs)
diff --git a/src/Propellor/Property/Ssh.hs b/src/Propellor/Property/Ssh.hs
index ea38980b..fa07c6f8 100644
--- a/src/Propellor/Property/Ssh.hs
+++ b/src/Propellor/Property/Ssh.hs
@@ -209,7 +209,7 @@ getHostPubKey = fromHostKeyInfo <$> askInfo
newtype HostKeyInfo = HostKeyInfo
{ fromHostKeyInfo :: M.Map SshKeyType PubKeyText }
- deriving (Eq, Ord, Typeable)
+ deriving (Eq, Ord, Typeable, Show)
instance IsInfo HostKeyInfo where
propagateInfo _ = False
@@ -230,7 +230,7 @@ getUserPubKeys u = maybe [] S.toList . M.lookup u . fromUserKeyInfo <$> askInfo
newtype UserKeyInfo = UserKeyInfo
{ fromUserKeyInfo :: M.Map User (S.Set (SshKeyType, PubKeyText)) }
- deriving (Eq, Ord, Typeable)
+ deriving (Eq, Ord, Typeable, Show)
instance IsInfo UserKeyInfo where
propagateInfo _ = False