Bug #7596

Plugin dependencies throw undefined method `to_sym' for nil:NilClass error

Added by Dominic Cleal about 3 years ago. Updated about 3 years ago.

Status:Closed
Priority:Normal
Assigned To:Dominic Cleal
Category:Plugins
Target version:Foreman - Sprint 29
Difficulty: Bugzilla link:
Found in release:1.6.0 Pull request:https://github.com/theforeman/smart-proxy/pull/213
Story points-
Velocity based estimate-
Release1.6.1Release relationshipAuto

Description

Adding a simple dependency to a plugin definition throws an ugly error when the plugin's loaded. There are quite a few more issues with the dependency verification beyond this one.

requires :dns, '~> 1.6.0'
/home/dcleal/code/foreman/smart-proxy/lib/proxy/plugin.rb:8:in `initialize': undefined method `to_sym' for nil:NilClass (NoMethodError)
    from /home/dcleal/code/foreman/smart-proxy/lib/proxy/plugin.rb:79:in `new'
    from /home/dcleal/code/foreman/smart-proxy/lib/proxy/plugin.rb:79:in `requires'
    from /home/dcleal/code/foreman/smart-proxy_hello/lib/smart_proxy_hello/hello_plugin.rb:12:in `<class:Plugin>'
    from /home/dcleal/code/foreman/smart-proxy_hello/lib/smart_proxy_hello/hello_plugin.rb:4:in `<module:Hello>'
    from /home/dcleal/code/foreman/smart-proxy_hello/lib/smart_proxy_hello/hello_plugin.rb:3:in `<top (required)>'
    from /home/dcleal/code/foreman/smart-proxy_hello/lib/smart_proxy_hello.rb:1:in `require'
    from /home/dcleal/code/foreman/smart-proxy_hello/lib/smart_proxy_hello.rb:1:in `<top (required)>'
    from /home/dcleal/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require'
    from /home/dcleal/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from /home/dcleal/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each'
    from /home/dcleal/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require'
    from /home/dcleal/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each'
    from /home/dcleal/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require'
    from /home/dcleal/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
    from /home/dcleal/code/foreman/smart-proxy/lib/bundler_helper.rb:25:in `require_groups'
    from /home/dcleal/code/foreman/smart-proxy/lib/smart_proxy.rb:23:in `<top (required)>'
    from bin/smart-proxy:5:in `require'
    from bin/smart-proxy:5:in `<main>'

Associated revisions

Revision 20b9f969
Added by Dominic Cleal about 3 years ago

fixes #7596 - validate plugin dependencies when loading, various fixes

History

#1 Updated by Dominic Cleal about 3 years ago

  • Status changed from New to Assigned
  • Assigned To set to Dominic Cleal
  • Target version set to Sprint 29

#2 Updated by The Foreman Bot about 3 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/smart-proxy/pull/213 added

#3 Updated by Dominic Cleal about 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal about 3 years ago

  • Release set to 1.6.1

Also available in: Atom PDF