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

Can't handle single quotes? (slurpstring) #90

Closed
beaufour opened this issue Mar 23, 2012 · 8 comments
Closed

Can't handle single quotes? (slurpstring) #90

beaufour opened this issue Mar 23, 2012 · 8 comments

Comments

@beaufour
Copy link

This fairly simple template breaks puppet-lint:

class test {
  $foo = 'bar'
}

If I use double quotes instead, it works.

$ /var/lib/gems/1.8/bin/puppet-lint test.pp
/var/lib/gems/1.8/gems/puppet-lint-0.1.12/bin/../lib/puppet-lint/plugins/check_strings.rb:13:in `slurpstring': wrong number of arguments (3 for 1) (ArgumentError)
from /var/lib/gems/1.8/gems/puppet-lint-0.1.12/bin/../lib/puppet-lint/plugins/check_strings.rb:13:in `convert'
from /usr/lib/ruby/1.8/puppet/parser/lexer.rb:360:in `munge_token'
from /usr/lib/ruby/1.8/puppet/parser/lexer.rb:428:in `scan'
from /usr/lib/ruby/1.8/puppet/parser/lexer.rb:257:in `fullscan'
from /var/lib/gems/1.8/gems/puppet-lint-0.1.12/bin/../lib/puppet-lint/plugin.rb:59:in `run'
from /var/lib/gems/1.8/gems/puppet-lint-0.1.12/bin/../lib/puppet-lint.rb:158:in `run'
from /var/lib/gems/1.8/gems/puppet-lint-0.1.12/bin/../lib/puppet-lint.rb:157:in `each'
from /var/lib/gems/1.8/gems/puppet-lint-0.1.12/bin/../lib/puppet-lint.rb:157:in `run'
from /var/lib/gems/1.8/gems/puppet-lint-0.1.12/bin/puppet-lint:85
from /var/lib/gems/1.8/bin/puppet-lint:19:in `load'
from /var/lib/gems/1.8/bin/puppet-lint:19

$ ruby --version
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]

$ /var/lib/gems/1.8/bin/puppet-lint --version
Puppet-lint 0.1.12
@rodjek
Copy link
Owner

rodjek commented Mar 23, 2012

I'm guessing it's because $var foo = 'bar'; isn't valid Puppet code, but if so it should be handled more gracefully. What version of Puppet are you running as well?

@beaufour
Copy link
Author

meh, did that testcase a little too fast. Give me a sec

@beaufour
Copy link
Author

This is actually valid, and fails with the same error:

class test {
  $foo = 'bar'
}

$ puppetd --version
0.25.4

@rodjek
Copy link
Owner

rodjek commented Mar 23, 2012

Ah, that'll be the problem. puppet-lint currently only supports Puppet >= 2.6. I'll look into how painful it'll be to add support for the legacy 0.2x releases.

@beaufour
Copy link
Author

Ah, bah. 0.25.4 is unfortunately the version that comes with Ubuntu 10.04 LTS :(

@rodjek
Copy link
Owner

rodjek commented Mar 23, 2012

In the meantime, I highly recommend pulling some more recent packages from http://apt.puppetlabs.com :)

@rodjek
Copy link
Owner

rodjek commented Mar 26, 2012

Just pushed version 0.1.13 that supports Puppet 0.25.x. Give it a go and let me know if you run into any issues with it.

@rodjek rodjek closed this as completed Mar 26, 2012
@beaufour
Copy link
Author

It works. Thanks for the really quick fix for this!

bastelfreak pushed a commit to bastelfreak/puppet-lint that referenced this issue Feb 28, 2023
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