fog / fog-openstack

Fog for OpenStack Platform
MIT License
69 stars 130 forks source link

fog 1.36.0 now fails to list tenants #55

Open plribeiro3000 opened 8 years ago

plribeiro3000 commented 8 years ago

Works in 1.35.0, now fails.
Stacktrace:

/Users/pivotal/.gem/ruby/2.2.3/gems/fog-1.36.0/lib/fog/openstack/requests/compute/list_tenants.rb:6:in `list_tenants': undefined method `request' for nil:NilClass (NoMethodError)
    from /Users/pivotal/.gem/ruby/2.2.3/gems/fog-1.36.0/lib/fog/openstack/models/compute/tenants.rb:11:in `all'
    from /Users/pivotal/.gem/ruby/2.2.3/gems/fog-core-1.34.0/lib/fog/core/collection.rb:113:in `lazy_load'
    from /Users/pivotal/.gem/ruby/2.2.3/gems/fog-core-1.34.0/lib/fog/core/collection.rb:17:in `map'
    from /Users/pivotal/.gem/ruby/2.2.3/gems/fog-core-1.34.0/lib/fog/formatador.rb:85:in `inspect_object'
    from /Users/pivotal/.gem/ruby/2.2.3/gems/fog-core-1.34.0/lib/fog/formatador.rb:72:in `block in nested_objects_string'
    from /Users/pivotal/.gem/ruby/2.2.3/gems/formatador-0.2.5/lib/formatador.rb:92:in `indent'
    from /Users/pivotal/.gem/ruby/2.2.3/gems/fog-core-1.34.0/lib/fog/formatador.rb:41:in `indent'
    from /Users/pivotal/.gem/ruby/2.2.3/gems/fog-core-1.34.0/lib/fog/formatador.rb:72:in `nested_objects_string'
    from /Users/pivotal/.gem/ruby/2.2.3/gems/fog-core-1.34.0/lib/fog/formatador.rb:54:in `object_string'
    from /Users/pivotal/.gem/ruby/2.2.3/gems/fog-core-1.34.0/lib/fog/formatador.rb:14:in `block in format'
    from /Users/pivotal/.gem/ruby/2.2.3/gems/formatador-0.2.5/lib/formatador.rb:92:in `indent'
    from /Users/pivotal/.gem/ruby/2.2.3/gems/fog-core-1.34.0/lib/fog/formatador.rb:41:in `indent'
    from /Users/pivotal/.gem/ruby/2.2.3/gems/fog-core-1.34.0/lib/fog/formatador.rb:14:in `format'
    from /Users/pivotal/.gem/ruby/2.2.3/gems/fog-core-1.34.0/lib/fog/core/collection.rb:73:in `inspect'
    from /Users/pivotal/Library/Preferences/RubyMine80/scratches/scratch_3:15:in `p'
    from /Users/pivotal/Library/Preferences/RubyMine80/scratches/scratch_3:15:in `<top (required)>'

Here's the code that we use to verify the bug:

gem 'fog', '1.36.0'
require 'fog'

c = Fog::Compute.new({
  provider: 'openstack',
  openstack_auth_url: 'http://10.85.40.2:5000/v2.0/tokens',
  openstack_identity_endpoint: 'http://10.85.40.2:5000/v2.0',
  openstack_username: 'admin',
  openstack_api_key: 'admin',
  openstack_region: 'RegionOne',
  connection_options: {}
})

p c.tenants

Original issue opened by @drich10 at fog/fog#3770

plribeiro3000 commented 8 years ago

cc/ @drich10 @seanhandley