summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-06-05 12:15:37 -0700
committerTim Smith <tsmith@chef.io>2021-06-05 12:15:37 -0700
commit18f81d23edddcf1d15b14ecb22aabbf5fc92b6e1 (patch)
tree70bc4b6fb894171a75d7b78cc5e050bbd35dac60 /lib
parentb8e8eacc474eb4f749e112aab0ff4ed0d0aec043 (diff)
downloadchef-18f81d23edddcf1d15b14ecb22aabbf5fc92b6e1.tar.gz
Handle arrays in the zypper repo template
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/provider/support/zypper_repo.erb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/chef/provider/support/zypper_repo.erb b/lib/chef/provider/support/zypper_repo.erb
index 6d508fa77f..23e871e406 100644
--- a/lib/chef/provider/support/zypper_repo.erb
+++ b/lib/chef/provider/support/zypper_repo.erb
@@ -1,15 +1,17 @@
-# This file was generated by Chef
+# This file was generated by Chef Infra
# Do NOT modify this file by hand.
[<%= @config.repo_name %>]
<% %w{ type enabled autorefresh gpgcheck gpgkey baseurl mirrorlist path priority keeppackages mode refresh_cache }.each do |prop| -%>
-<% next if @config.send(prop.to_sym).nil? -%>
+<% next if @config.send(prop.to_sym).nil? || (@config.send(prop.to_sym).is_a?(Array) && @config.send(prop.to_sym).empty?) -%>
<%= prop %>=<%=
case @config.send(prop.to_sym)
when TrueClass
'1'
when FalseClass
'0'
+ when Array
+ @config.send(prop.to_sym).join("\n ")
else
@config.send(prop.to_sym)
end %>