Skip to content

Commit

Permalink
fix(chocolatey): verify chocolatey dicts are not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
kartnico authored and myii committed Mar 30, 2020
1 parent c0c1195 commit 385b223
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/chocolatey.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# vim: ft=sls
{% from "packages/map.jinja" import packages with context %}
{% if packages.chocolatey %}
{% set req_states = packages.chocolatey.required.states %}
{% set req_pkgs = packages.chocolatey.required.pkgs %}
{% set wanted_chocolatey = packages.chocolatey.wanted %}
Expand All @@ -20,6 +21,7 @@ chocolatey_req_pkgs:
- retry: {{ packages.retry_options|json }}
### CHOCOLATEY PACKAGES to install
{% if wanted_chocolatey %}
{% for choco, settings in wanted_chocolatey.items() %}
{{ choco }}:
chocolatey.installed:
Expand All @@ -34,10 +36,14 @@ chocolatey_req_pkgs:
- package_args: {{ '' if 'package_args' not in settings else settings.package_args }}
- allow_multiple: {{ False if 'allow_multiple' not in settings else settings.allow_multiple }}
{% endfor %}
{% endif %}
### CHOCOLATEY PACKAGES to uninstall
{% if unwanted_chocolatey %}
{% for uchoco in unwanted_chocolatey %}
{{ uchoco }}:
chocolatey.uninstalled:
- name: {{ uchoco }}
{% endfor %}
{% endif %}
{% endif %}

0 comments on commit 385b223

Please sign in to comment.