voxpupuli / puppet-syntax

Syntax checks for Puppet manifests and templates
MIT License
68 stars 51 forks source link

undefined method `info' w/ Puppet 4 #54

Closed bryanandrews closed 7 years ago

bryanandrews commented 8 years ago

I have a puppet module that is only failing with puppet 4 and puppet-syntax v2.1.0. Yet when I run it locally on my shell with puppet 4 it rake works. Both are using Ruby 2.3.0 and both are using puppet-syntax v2.1.0. Does anyone know what the problem could be?

--------------- Travis CI log ------------------

$ export PUPPET_GEM_VERSION="~> 4.2.0"
$ export STRICT_VARIABLES=yes
$ export FUTURE_PARSER=yes
rvm
25.77s$ rvm use 2.3.0 --install --binary --fuzzy
ruby-2.3.0 is not installed - installing.
<-- cut -->
$ ruby --version
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
$ rvm --version
rvm 1.26.10 (latest-minor) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
$ bundle --version
Bundler version 1.12.5
$ gem --version
2.5.1
before_install
0.00s$ rm Gemfile.lock || true
rm: cannot remove `Gemfile.lock': No such file or directory
install.bundler
33.35s$ bundle install --without development system_tests
Fetching https://github.com/rodjek/rspec-puppet.git
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Resolving dependencies........
Installing rake 11.1.2
Installing CFPropertyList 2.2.8
Installing ansi 1.5.0
Installing ast 2.3.0
Installing diff-lcs 1.2.5
Installing docile 1.1.5
Installing facter 2.4.6
Using json 1.8.3
Installing json_pure 1.8.3
Installing hirb 0.7.3
Installing stomp 1.3.5
Installing systemu 2.6.5
Installing metaclass 0.0.4
Installing spdx-licenses 1.1.0
Installing powerpack 0.1.1
Installing puppet-lint 1.1.0
Installing rspec-support 3.1.2
Installing rainbow 2.1.0
Installing ruby-progressbar 1.8.1
Installing simplecov-html 0.10.0
Installing spawn 0.1.4
Installing syck 1.1.0 with native extensions
Using bundler 1.12.5
Installing puppet-syntax 2.1.0
Installing parser 2.3.1.2
Installing jgrep 1.4.1
Installing hiera 3.2.0
Installing mcollective-client 2.8.4
Installing mocha 1.1.0
Installing metadata-json-lint 0.0.11
Installing puppet-lint-absolute_classname-check 0.1.3
Installing puppet-lint-classes_and_types_beginning_with_digits-check 0.1.0
Installing puppet-lint-leading_zero-check 0.1.0
Installing puppet-lint-resource_reference_syntax 1.0.8
Installing puppet-lint-trailing_comma-check 0.3.1
Installing puppet-lint-unquoted_string-check 0.2.5
Installing puppet-lint-version_comparison-check 0.1.2
Installing rspec-core 3.1.7
Installing rspec-expectations 3.1.2
Installing rspec-mocks 3.1.3
Installing simplecov 0.11.2
Installing astrolabe 1.3.1
Installing facterdb 0.3.5
Installing puppet 4.2.3
Installing rspec 3.1.0
Installing simplecov-console 0.3.0
Installing rubocop 0.33.0
Installing rspec-puppet-facts 1.6.1
Using rspec-puppet 2.4.0 from https://github.com/rodjek/rspec-puppet.git (at master@79d5373)
Installing puppetlabs_spec_helper 1.1.1
Bundle complete! 26 Gemfile dependencies, 50 gems now installed.
Gems in the groups development and system_tests were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
1.00s$ bundle exec rake test
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
rake aborted!
NoMethodError: undefined method `info' for #<PuppetSyntax::RakeTask:0x00000003b34cc0>
/home/travis/.rvm/gems/ruby-2.3.0/gems/puppet-syntax-2.1.0/lib/puppet-syntax/tasks/puppet-syntax.rb:34:in `block (2 levels) in initialize'
/home/travis/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
/home/travis/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => test => syntax => syntax:manifests
(See full trace by running task with --trace)
The command "bundle exec rake test" exited with 1.
Done. Your build exited with 1.
deanwilson commented 8 years ago

Hi @bryanandrews, can you try the current release of puppet-syntax and see if this is still an issue please? Hopefully the work we did in https://github.com/gds-operations/puppet-syntax/commit/93ee49e52450e388e179b24e1c9ac136320454bd has fixed this.

Thanks for reporting the problem.

maxgaulhofer commented 8 years ago

Still having this issue on Windows 10: ruby --version ruby 2.2.4p230 (2015-12-16 revision 53155) [x64-mingw32] * LOCAL GEMS *

addressable (2.4.0) aws-sdk (1.66.0) aws-sdk-v1 (1.66.0) beaker (2.42.0, 2.35.0) beaker-answers (0.6.0, 0.4.0) beaker-hiera (0.1.1) beaker-pe (0.12.1, 0.2.0) beaker-rspec (5.4.0, 5.3.0) bigdecimal (default: 1.2.6) builder (3.2.2) bundler (1.12.4) CFPropertyList (2.3.3, 2.3.2) coderay (1.1.1) concurrent-ruby (1.0.2) diff-lcs (1.2.5) docker-api (1.32.1, 1.26.2) domain_name (0.5.20160826) excon (0.54.0, 0.47.0) facter (2.4.6 x64-mingw32) facterdb (0.3.8) faraday (0.9.2) faraday-cookie_jar (0.0.6) ffi (1.9.14 x64-mingw32, 1.9.10 x64-mingw32) fission (0.5.0) fog (1.34.0) fog-atmos (0.1.0) fog-aws (0.8.1) fog-brightbox (0.10.1) fog-core (1.36.0) fog-dynect (0.0.2) fog-ecloud (0.3.0) fog-google (0.0.9) fog-json (1.0.2) fog-local (0.2.1) fog-powerdns (0.1.1) fog-profitbricks (0.0.5) fog-radosgw (0.0.5) fog-riakcs (0.1.0) fog-sakuracloud (1.7.5) fog-serverlove (0.1.2) fog-softlayer (1.1.0) fog-storm_on_demand (0.1.1) fog-terremark (0.1.0) fog-vmfusion (0.1.0) fog-voxel (0.1.0) fog-xml (0.1.2) formatador (0.2.5) google-api-client (0.9.4, 0.9.3) googleauth (0.5.1) gssapi (1.2.0) gyoku (1.3.1) hiera (3.2.1 x64-mingw32, 3.2.0 x64-mingw32, 3.0.6 x64-mingw32, 1.3.4) hocon (0.9.5) http-cookie (1.0.3) httpclient (2.8.2.4, 2.7.1) hurley (0.2) inflecto (0.0.2) inifile (2.0.2) io-console (default: 0.4.3) ipaddress (0.8.3) jgrep (1.4.1) json (2.0.2, 1.8.3, default: 1.8.1) json_pure (2.0.2, 1.8.3) jwt (1.5.6, 1.5.3) little-plugger (1.1.4) logging (2.1.0, 2.0.0) mcollective-client (2.9.0) memoist (0.15.0, 0.14.0) metaclass (0.0.4) metadata-json-lint (0.0.11) method_source (0.8.2) mime-types (3.1, 2.99.1) mime-types-data (3.2016.0521) mini_portile2 (2.1.0, 2.0.0) minitar (0.5.4) minitest (5.9.1, 5.4.3) mocha (1.2.1, 1.1.0, 0.10.5) ms_rest (0.2.1) ms_rest_azure (0.2.3) multi_json (1.12.1, 1.11.2) multipart-post (2.0.0) net-scp (1.2.1) net-ssh (2.9.4) net-telnet (0.1.1) nokogiri (1.6.8.1 x64-mingw32, 1.6.7.2 x64-mingw32) nori (2.6.0) open_uri_redirections (0.2.1) os (0.9.6) power_assert (0.2.2) pry (0.10.4) psych (default: 2.0.8) puppet (4.5.3 x64-mingw32, 4.5.0 x64-mingw32, 4.3.2 x64-mingw32, 3.8.7 x64-mingw32) puppet-lint (2.0.2, 1.1.0) puppet-lint-absolute_classname-check (0.1.3) puppet-lint-classes_and_types_beginning_with_digits-check (0.1.0) puppet-lint-leading_zero-check (0.1.0) puppet-lint-resource_reference_syntax (1.0.8) puppet-lint-trailing_comma-check (0.3.1) puppet-lint-unquoted_string-check (0.2.5) puppet-lint-version_comparison-check (0.1.2) puppet-syntax (2.1.0) puppet_facts (0.2.1) puppetlabs_spec_helper (1.2.2, 1.1.1, 1.1.0) rake (10.5.0, default: 10.4.2) rbvmomi (1.9.4, 1.8.2) rdoc (default: 4.2.0) representable (2.3.0) require_all (1.3.3) retriable (2.1.0) rspec (3.4.0, 3.1.0) rspec-core (3.4.4, 3.4.3, 3.1.7) rspec-expectations (3.4.0, 3.1.2) rspec-its (1.2.0) rspec-mocks (3.4.1, 3.1.3) rspec-puppet (2.4.0, 2.3.2) rspec-puppet-facts (1.6.1) rspec-puppet-utils (2.2.1) rspec-support (3.4.1, 3.1.2) rsync (1.0.9) rubygems-update (2.6.7, 2.2.3) rubyntlm (0.6.1) serverspec (2.37.2, 2.30.0) sfl (2.3, 2.2) signet (0.7.3, 0.7.2) slop (3.6.0) spdx-licenses (1.0.0) specinfra (2.63.3, 2.52.0) stomp (1.4.3) stringify-hash (0.0.2) systemu (2.6.5) test-unit (3.0.8) thor (0.19.1) timeliness (0.3.8) trollop (2.1.2) uber (0.0.15) unf (0.1.4) unf_ext (0.0.7.2 x64-mingw32) vagrant-wrapper (2.0.3) win32-dir (0.4.9) win32-eventlog (0.6.5) win32-process (0.7.5) win32-security (0.2.5) win32-service (0.8.7) winrm (1.8.1)

Any suggestions are appreciated

domcleal commented 7 years ago

puppet-syntax (2.1.0)

The fix was shipped in puppet-syntax 2.1.1, you need to run a bundle update puppet-syntax. Closing as it appears to have been fixed per the above comment. Please open a new issue if you hit a new error.