Closed Martin-Barr closed 2 years ago
I found your solution in the code. I have now implemented and it is working.
I found your solution in the code. I have now implemented and it is working.
Can you elaborate on the solution? I'm not sophisticated in Python or Salt and just followed the existing configuration and pillar.example file and I'm totally lost
I found your solution in the code. I have now implemented and it is working.
These types of answers are the dredge of github and all programming help area's society. If you happen upon this page, don't do this.
Just in case anyone else stumbles across this same error, the fix mentioned above is found in this commit: https://github.com/saltstack-formulas/postfix-formula/commit/c432ae23dcc2b932a4431df952e3a04dbda85fd0
In postfix/files/mapping.j2
change:
{{ format_value(item.keys()[0], item.values()[0]) }}
to:
{%- set key, value = item.popitem() %}
{{ format_value(key, value) }}
Your setup
Formula commit hash / release tag
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = https://github.com/saltstack-formulas/postfix-formula fetch = +refs/heads/:refs/remotes/origin/ [branch "master"] remote = origin merge = refs/heads/master
Versions reports (master & minion)
salt3004.1
Pillar / config used
Our postfix.sls update file
!jinja|yaml|gpg
postfix: config: relayhost: '[email-smtp.eu-west-2.amazonaws.com]:587' smtp_sasl_auth_enable: 'yes' smtp_sasl_security_options: noanonymous smtp_sasl_password_maps: hash:/etc/postfix/sasl_passwd sender_canonical_maps: hash:/etc/postfix/canonical smtp_use_tls: 'yes' smtp_tls_security_level: encrypt smtp_tls_note_starttls_offer: 'yes' smtp_tls_CAfile: /etc/pki/tls/certs/ca-bundle.crt mapping: smtp_sasl_password_maps:
Bug details
Describe the bug
In Python 2, calling the "values" method of a dictionary returned a list that then could be accessed using an index, but in Python 3 the "values" method returns a iterable object that can't be indexed.
Steps to reproduce the bug
Salt-3004.1 server Salt-minion linux 7.9
github postfix formulas
Expected behaviour
You will get the same output as I did
Attempts to fix the bug
No attempts to fix yet
Additional context
N/A