From 2a30b0a9cda25a6d1178efd02da3e46c9b047493 Mon Sep 17 00:00:00 2001 From: jeanluc Date: Mon, 5 Dec 2022 12:44:10 +0100 Subject: [PATCH] Limit keyring to a single one --- salt/modules/gpg.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/salt/modules/gpg.py b/salt/modules/gpg.py index 5cfc0bcda32..c2a8d13c9a8 100644 --- a/salt/modules/gpg.py +++ b/salt/modules/gpg.py @@ -192,6 +192,11 @@ def _create_gpg(user=None, gnupghome=None, keyring=None): if not gnupghome: gnupghome = _get_user_gnupghome(user) + if keyring and not isinstance(keyring, str): + raise SaltInvocationError( + "Please pass keyring as a string. Multiple keyrings are not allowed" + ) + gpg = gnupg.GPG(gnupghome=gnupghome, keyring=keyring) return gpg