From a35c50d2cdc0bc6fe6f7cc49103d6e94ea406839 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Oct 2015 19:43:59 -0400 Subject: Added Ssh properties to remove authorized_keys and known_hosts lines. And use when reverting conductor property. Note that I didn't convert existing ssh properties to RevertablePropery because the API change was too annoying to work through. --- src/Propellor/Property/File.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Propellor/Property/File.hs') diff --git a/src/Propellor/Property/File.hs b/src/Propellor/Property/File.hs index 08fdc780..7e421cb7 100644 --- a/src/Propellor/Property/File.hs +++ b/src/Propellor/Property/File.hs @@ -67,6 +67,9 @@ f `containsLines` ls = fileProperty (f ++ " contains:" ++ show ls) go f lacksLine :: FilePath -> Line -> Property NoInfo f `lacksLine` l = fileProperty (f ++ " remove: " ++ l) (filter (/= l)) f +lacksLines :: FilePath -> [Line] -> Property NoInfo +f `lacksLines` ls = fileProperty (f ++ " remove: " ++ show [ls]) (filter (`notElem` ls)) f + -- | Removes a file. Does not remove symlinks or non-plain-files. notPresent :: FilePath -> Property NoInfo notPresent f = check (doesFileExist f) $ property (f ++ " not present") $ -- cgit v1.3-2-g0d8e