diff options
-rw-r--r-- | lib/chef/provider/support/zypper_repo.erb | 6 |
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 %> |