summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Gpg.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Property/Gpg.hs')
-rw-r--r--src/Propellor/Property/Gpg.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Propellor/Property/Gpg.hs b/src/Propellor/Property/Gpg.hs
index dae6e5d7..fe339297 100644
--- a/src/Propellor/Property/Gpg.hs
+++ b/src/Propellor/Property/Gpg.hs
@@ -54,11 +54,9 @@ dotDir (User u) = do
return $ home </> ".gnupg"
hasPrivKey :: GpgKeyId -> User -> IO Bool
-hasPrivKey (GpgKeyId keyid) (User u) = do
- value <- catchMaybeIO $ readProcess "su" ["-c", "gpg --list-secret-keys " ++ keyid, u]
- return $ isJust value
+hasPrivKey (GpgKeyId keyid) (User u) = catchBoolIO $
+ snd <$> processTranscript "su" ["-c", "gpg --list-secret-keys", keyid, u] Nothing
hasPubKey :: GpgKeyId -> User -> IO Bool
-hasPubKey (GpgKeyId keyid) (User u) = do
- value <- catchMaybeIO $ readProcess "su" ["-c", "gpg --list-public-keys " ++ keyid, u]
- return $ isJust value
+hasPubKey (GpgKeyId keyid) (User u) = catchBoolIO $
+ snd <$> processTranscript "su" ["-c", "gpg --list-public-keys", keyid, u] Nothing