Skip to content

Commit

Permalink
gnupg: set home dir with parameter, not env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
wagner-intevation committed Aug 30, 2024
1 parent 1edc295 commit e16db5b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions intelmqmail/cb.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def send_notifications(config, directives, cur, scripts, template: Optional[Temp
gpgme_ctx = None

if config["openpgp"]["always_sign"]:
gpgme_ctx = gpg.Context()
gpgme_ctx = gpg.Context(home_dir=config["openpgp"]["gnupg_home"])
signing_key = gpgme_ctx.get_key(config["openpgp"]["signing_key"])
gpgme_ctx.signers = [signing_key]

Expand Down Expand Up @@ -437,8 +437,6 @@ def start(config: dict, process_all=False, template: Optional[str] = None, templ
} != config["openpgp"].keys():
log.critical("Config section openpgp missing or incomplete. Exiting.")
sys.exit(1)
# setting up gnupg
os.environ['GNUPGHOME'] = config["openpgp"]["gnupg_home"]

scripts = load_script_entry_points(config)
if not scripts:
Expand Down

0 comments on commit e16db5b

Please sign in to comment.