From fd1e01c853d9aff6435b3421f4134a63144fa2b5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 4 Jan 2015 17:14:07 -0400 Subject: avoid ever removing all host keys --- src/Propellor/Property/Ssh.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Property/Ssh.hs') 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 -- cgit v1.2.3