Skip to content

Commit

Permalink
Catch timeouts when checking for GPG availability.
Browse files Browse the repository at this point in the history
Fixes secure-systems-lab#428. Okay to do this because we will fail tests if GPG is unexpectedly
unavailable (secure-systems-lab#434).

Signed-off-by: Zachary Newman <[email protected]>
  • Loading branch information
znewman01 committed Oct 13, 2022
1 parent ede1a48 commit 581ed90
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion securesystemslib/gpg/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import functools
import logging
import os
import subprocess

from securesystemslib import process

Expand All @@ -30,7 +31,7 @@ def is_available_gnupg(gnupg: str) -> bool:
try:
process.run(gpg_version_cmd, stdout=process.PIPE, stderr=process.PIPE)
return True
except OSError:
except (OSError, subprocess.TimeoutExpired):
return False


Expand Down

0 comments on commit 581ed90

Please sign in to comment.