PR progress checklist (to be filled in by reviewers)
[x] Changes to documentation are appropriate (or tick if not required)
[x] Changes to tests are appropriate (or tick if not required)
[ ] Reviews completed
What type of PR is this?
Primary type
[ ] [build] Changes related to the build system
[ ] [chore] Changes to the build process or auxiliary tools and libraries such as documentation generation
[ ] [ci] Changes to the continuous integration configuration
[ ] [feat] A new feature
[x] [fix] A bug fix
[ ] [perf] A code change that improves performance
[ ] [refactor] A code change that neither fixes a bug nor adds a feature
[ ] [revert] A change used to revert a previous commit
[ ] [style] Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
Secondary type
[ ] [docs] Documentation changes
[ ] [test] Adding missing or correcting existing tests
Does this PR introduce a BREAKING CHANGE?
No.
Related issues and/or pull requests
Fixes #40
Describe the changes you're proposing
Fixes this error in Salt 3002.5 on FreeBSD 12.2:
----------
ID: snmp_conf
Function: file.managed
Name: /usr/local/etc/snmp/snmpd.conf
Result: False
Comment: Unable to manage file: Jinja syntax error: access to attribute '__class__' of 'list' object is unsafe.;
line 513
---
[...]
rwuser {{ user.username }} {{ user.get('securitylevel', 'auth') }} -V {{ user.view }}
createUser {{ user.username }} {{ user.get('authproto', 'MD5') }} {{ user.get('authpassphrase', user.pas
sphrase) }} {{ user.get('privproto', 'AES') }} {{ user.get('privpassphrase', user.passphrase) }}
{%- endfor %}
{% for declaration, values in config.items() %}
{%- if values.__class__ in (().__class__, [].__class__) %} <======================
{%- for value in values %}
{{declaration}} {{value}}
{%- endfor %}
{%- else %}
{{declaration}} {{values}}
[...]
---
Started: 02:55:22.889450
Duration: 202.968 ms
Changes:
Pillar / config required to test the proposed changes
Debug log showing how the proposed changes work
% salt 'main.srv.tty1.eu' state.apply snmp.managed
main.srv.tty1.eu:
----------
ID: snmp
Function: pkg.installed
Name: net-snmp
Result: True
Comment: All specified packages are already installed
Started: 03:16:05.653761
Duration: 86.867 ms
Changes:
----------
ID: snmp_conf
Function: file.managed
Name: /usr/local/etc/snmp/snmpd.conf
Result: True
Comment: File /usr/local/etc/snmp/snmpd.conf is in the correct state
Started: 03:16:05.746414
Duration: 211.492 ms
Changes:
----------
ID: snmp
Function: service.running
Name: snmpd
Result: True
Comment: The service snmpd is already running
Started: 03:16:05.958180
Duration: 83.13 ms
Changes:
Summary for main.srv.tty1.eu
------------
Succeeded: 3
Failed: 0
------------
Total states run: 3
Total run time: 381.489 ms
Documentation checklist
[ ] Updated the README (e.g. Available states).
[ ] Updated pillar.example.
Testing checklist
[ ] Included in Kitchen (i.e. under state_top).
[ ] Covered by new/existing tests (e.g. InSpec, Serverspec, etc.).
PR progress checklist (to be filled in by reviewers)
What type of PR is this?
Primary type
[build]
Changes related to the build system[chore]
Changes to the build process or auxiliary tools and libraries such as documentation generation[ci]
Changes to the continuous integration configuration[feat]
A new feature[fix]
A bug fix[perf]
A code change that improves performance[refactor]
A code change that neither fixes a bug nor adds a feature[revert]
A change used to revert a previous commit[style]
Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)Secondary type
[docs]
Documentation changes[test]
Adding missing or correcting existing testsDoes this PR introduce a
BREAKING CHANGE
?No.
Related issues and/or pull requests
Fixes #40
Describe the changes you're proposing
Fixes this error in Salt 3002.5 on FreeBSD 12.2:
Pillar / config required to test the proposed changes
Debug log showing how the proposed changes work
Documentation checklist
README
(e.g.Available states
).pillar.example
.Testing checklist
state_top
).Additional context