avoid ever removing all host keys

This commit is contained in:
Joey Hess 2015-01-04 17:14:07 -04:00
parent 017e1928d4
commit fd1e01c853
1 changed files with 2 additions and 2 deletions

View File

@ -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