0
0
mirror of https://github.com/saltstack-formulas/users-formula.git synced 2025-02-17 17:54:41 +01:00

For some reason pillar.get does not return [], but None

If absent_users is in the pillar file and contains now users, pillar.get returns a None type.  This causes the template to fail to render.  Added a check to replace None with [] to fix this issue.
This commit is contained in:
Josh Abadie 2013-10-29 15:46:49 -05:00
parent b41c70a6d1
commit 992df285c5

View File

@ -125,7 +125,11 @@ sudoer-{{ name }}:
{% endfor %}
{% for user in pillar.get('absent_users', []) %}
{% set users = pillar.get('absent_users', []) %}
{% if users == None %}
{% set users = [] %}
{% endif %}
{% for user in users %}
{{ user }}:
user.absent
/etc/sudoers.d/{{ user }}: