Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

puppet-lint dies with inline_template syntax #656

Closed
TomaszUrugOlszewski opened this issue Mar 16, 2017 · 1 comment
Closed

puppet-lint dies with inline_template syntax #656

TomaszUrugOlszewski opened this issue Mar 16, 2017 · 1 comment
Milestone

Comments

@TomaszUrugOlszewski
Copy link

Hello,

This syntax is based on https://docs.puppet.com/puppet/4.9/lang_template.html
Example code:

class nope {
  $htpasswd_template = @(END)
<%- @htpasswd.keys.each do |x| -%>
<%- if @htpasswd[x].key?('password') -%>
<%= x %>:<%= @htpasswd[x]['password'] %>
<%- end -%>
<%- end -%>
END
  file { $htpasswd_file:
    ensure => file,
    owner  => 'root',
    group  => 'www-data',
    mode   => '0640',
    content => inline_template($htpasswd_template)
  }
}

And beautiful error:

/var/lib/gems/2.1.0/gems/puppet-lint-2.1.1/lib/puppet-lint/plugins/check_whitespace.rb:181:in `block (2 levels) in check': undefined method `each' for nil:NilClass (NoMethodError)
	from /var/lib/gems/2.1.0/gems/puppet-lint-2.1.1/lib/puppet-lint/plugins/check_whitespace.rb:144:in `each'
	from /var/lib/gems/2.1.0/gems/puppet-lint-2.1.1/lib/puppet-lint/plugins/check_whitespace.rb:144:in `each_with_index'
	from /var/lib/gems/2.1.0/gems/puppet-lint-2.1.1/lib/puppet-lint/plugins/check_whitespace.rb:144:in `block in check'
	from /var/lib/gems/2.1.0/gems/puppet-lint-2.1.1/lib/puppet-lint/plugins/check_whitespace.rb:127:in `each'
	from /var/lib/gems/2.1.0/gems/puppet-lint-2.1.1/lib/puppet-lint/plugins/check_whitespace.rb:127:in `check'
	from /var/lib/gems/2.1.0/gems/puppet-lint-2.1.1/lib/puppet-lint/checkplugin.rb:21:in `run'
	from /var/lib/gems/2.1.0/gems/puppet-lint-2.1.1/lib/puppet-lint/checks.rb:58:in `block in run'
	from /var/lib/gems/2.1.0/gems/puppet-lint-2.1.1/lib/puppet-lint/checks.rb:56:in `each'
	from /var/lib/gems/2.1.0/gems/puppet-lint-2.1.1/lib/puppet-lint/checks.rb:56:in `run'
	from /var/lib/gems/2.1.0/gems/puppet-lint-2.1.1/lib/puppet-lint.rb:191:in `run'
	from /var/lib/gems/2.1.0/gems/puppet-lint-2.1.1/lib/puppet-lint/bin.rb:59:in `block in run'
	from /var/lib/gems/2.1.0/gems/puppet-lint-2.1.1/lib/puppet-lint/bin.rb:56:in `each'
	from /var/lib/gems/2.1.0/gems/puppet-lint-2.1.1/lib/puppet-lint/bin.rb:56:in `run'
	from /var/lib/gems/2.1.0/gems/puppet-lint-2.1.1/bin/puppet-lint:7:in `<top (required)>'
	from /usr/local/bin/puppet-lint:23:in `load'
	from /usr/local/bin/puppet-lint:23:in `<main>'
@rodjek
Copy link
Owner

rodjek commented Mar 22, 2017

This is due to the lack of support for heredocs in the current release of puppet-lint. There is a fix for this in #650 which should be part of the next release.

@rodjek rodjek modified the milestone: 2.2.0 Mar 25, 2017
@rodjek rodjek closed this as completed Mar 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants