summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFĂ©lix Sipma2015-12-14 09:24:12 +0100
committerJoey Hess2015-12-16 12:04:55 -0400
commitf77badde96531d3723c633084dd82597214d0f38 (patch)
tree38add3ea5b0ca9394bb095c83cc8656eed3dec1c /src
parente030dd833d57e2023f387a73b9d64fce4aa6145f (diff)
Gpg: use isJust
(cherry picked from commit 1bb2377598e447e81e20a0e1de1a5d466851d655)
Diffstat (limited to 'src')
-rw-r--r--src/Propellor/Property/Gpg.hs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/Propellor/Property/Gpg.hs b/src/Propellor/Property/Gpg.hs
index 59448bca..34c077bb 100644
--- a/src/Propellor/Property/Gpg.hs
+++ b/src/Propellor/Property/Gpg.hs
@@ -45,13 +45,9 @@ dotDir (User u) = do
hasPrivKey :: GpgKeyId -> User -> IO Bool
hasPrivKey (GpgKeyId keyid) (User u) = do
value <- catchMaybeIO $ readProcess "su" ["-c", "gpg --list-secret-keys " ++ keyid, u]
- return $ case value of
- Just _ -> True
- _ -> False
+ return $ isJust value
hasPubKey :: GpgKeyId -> User -> IO Bool
hasPubKey (GpgKeyId keyid) (User u) = do
value <- catchMaybeIO $ readProcess "su" ["-c", "gpg --list-public-keys " ++ keyid, u]
- return $ case value of
- Just _ -> True
- _ -> False
+ return $ isJust value