Skip to content

Commit

Permalink
Allow automatic trustdb checks to be disabled.
Browse files Browse the repository at this point in the history
Skip auto trustdb creation if option to not refer to it is given
  • Loading branch information
charles-dyfis-net committed Nov 7, 2015
1 parent 665f1b6 commit 4f811e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions gnupg/_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ def _get_options_group(group=None):
'--lock-multiple',
'--lock-never',
'--lock-once',
'--no-auto-check-trustdb',
'--no-default-keyring',
'--no-default-recipient',
'--no-emit-version',
Expand Down
3 changes: 2 additions & 1 deletion gnupg/gnupg.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def __init__(self, binary=None, homedir=None, verbose=False,

# Make sure that the trustdb exists, or else GnuPG will exit with a
# fatal error (at least it does with GnuPG>=2.0.0):
self.create_trustdb()
if not (self.options is not None and '--no-auto-check-trustdb' in self.options):
self.create_trustdb()

# The --no-use-agent and --use-agent options were deprecated in GnuPG
# 2.x, so we should set use_agent to None here to avoid having
Expand Down

0 comments on commit 4f811e6

Please sign in to comment.