Open mschiff opened 5 years ago
No time for a PR, but for me this diff fixes the returner:
--- a/salt/returners/smtp_return.py 2019-02-25 15:53:14.000000000 +0100
+++ b/salt/returners/smtp_return.py 2019-09-24 01:43:03.469536287 +0200
@@ -217,10 +217,13 @@
input_data=template,
**ret)
+ if isinstance(content, six.moves.StringIO):
+ content = content.read()
+
if gpgowner:
if HAS_GNUPG:
gpg = gnupg.GPG(gnupghome=os.path.expanduser('~{0}/.gnupg'.format(gpgowner)),
- options=['--trust-model always'])
+ options=['--trust-model=always'])
encrypted_data = gpg.encrypt(content, to_addrs)
if encrypted_data.ok:
log.debug('smtp_return: Encryption successful')
Thanks for bring this up
Description of Issue
The smtp.gpgowner option is not working (anymore).
First error is that gpg will not accept the option "--trust-model always" this way:
When changing the code so it reads "--trust-model=always" (added the "=") then it seems to work, but then this error occurs:
Setup
GnuPG Version: 2.2.17 python gnupg: 0.4.3
master config snipped
Anf with a valid gnupg home being in /etc/salt/.gnupg
Steps to Reproduce Issue
salt-call state.highstate
Versions Report