Skip to content

Commit 385b223

Browse files
kartnicomyii
authored andcommitted
fix(chocolatey): verify chocolatey dicts are not empty
1 parent c0c1195 commit 385b223

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/chocolatey.sls

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# vim: ft=sls
33
{% from "packages/map.jinja" import packages with context %}
44
5+
{% if packages.chocolatey %}
56
{% set req_states = packages.chocolatey.required.states %}
67
{% set req_pkgs = packages.chocolatey.required.pkgs %}
78
{% set wanted_chocolatey = packages.chocolatey.wanted %}
@@ -20,6 +21,7 @@ chocolatey_req_pkgs:
2021
- retry: {{ packages.retry_options|json }}
2122
2223
### CHOCOLATEY PACKAGES to install
24+
{% if wanted_chocolatey %}
2325
{% for choco, settings in wanted_chocolatey.items() %}
2426
{{ choco }}:
2527
chocolatey.installed:
@@ -34,10 +36,14 @@ chocolatey_req_pkgs:
3436
- package_args: {{ '' if 'package_args' not in settings else settings.package_args }}
3537
- allow_multiple: {{ False if 'allow_multiple' not in settings else settings.allow_multiple }}
3638
{% endfor %}
39+
{% endif %}
3740
3841
### CHOCOLATEY PACKAGES to uninstall
42+
{% if unwanted_chocolatey %}
3943
{% for uchoco in unwanted_chocolatey %}
4044
{{ uchoco }}:
4145
chocolatey.uninstalled:
4246
- name: {{ uchoco }}
4347
{% endfor %}
48+
{% endif %}
49+
{% endif %}

0 commit comments

Comments
 (0)