Closed otheus closed 6 years ago
@otheus Thanks. It might be possible to simplify this though. Does
<%- unless @domains.empty? -%>
search <%= @domains.split(' ') -%>
<%- end -%>
<%- unless @options.empty? -%>
options <%= @options.split(' ') -%>
<%- end -%>
work?
I think @options.empty?
will throw an exception if options
is not defined (or perhaps in older versions of puppet). I will test and get back to you.
Found another bug. Don't merge yet.
@alexjfisher I think you menat .join() here, not .split(). And if options is omitted, the ERB fails without the nil check. The validate_array() in the new code is also incorrect, since "options" are actually optional. New commit forthcoming.
@otheus Yeah, I did mean join (I often get those mixed up)! You're correct in thinking I had seen the validate_array code. If that's wrong, then you will need to check it exists.
You probably don't need the defined?
though.
<% if @domains && @domains.any? -%>
should do.
Fixes issue #37