summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Ssh.hs
diff options
context:
space:
mode:
authorJoey Hess2015-01-04 17:14:07 -0400
committerJoey Hess2015-01-04 17:14:07 -0400
commitfd1e01c853d9aff6435b3421f4134a63144fa2b5 (patch)
treec35722386330d689d8b6ea86a8147e95d78680d4 /src/Propellor/Property/Ssh.hs
parent017e1928d4ec5f7a132ce2ad4c2c97c0b89fbcab (diff)
avoid ever removing all host keys
Diffstat (limited to 'src/Propellor/Property/Ssh.hs')
-rw-r--r--src/Propellor/Property/Ssh.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Propellor/Property/Ssh.hs b/src/Propellor/Property/Ssh.hs
index 4f8ee32e..b6ed476e 100644
--- a/src/Propellor/Property/Ssh.hs
+++ b/src/Propellor/Property/Ssh.hs
@@ -98,8 +98,8 @@ hostKeys ctx l = propertyList desc $ catMaybes $
staletypes = let have = map fst l in filter (`notElem` have) alltypes
removestale b = map (File.notPresent . flip keyFile b) staletypes
cleanup
- | null staletypes = Nothing
- | otherwise = Just $ property ("stale host keys removed " ++ typelist staletypes) $
+ | null staletypes || null l = Nothing
+ | otherwise = Just $ property ("any other ssh host keys removed " ++ typelist staletypes) $
ensureProperty $
combineProperties desc (removestale True ++ removestale False)
`onChange` restarted