fog-openstack icon indicating copy to clipboard operation
fog-openstack copied to clipboard

Glance v2 image api's private/public method error

Open zhoutiekui opened this issue 8 years ago • 2 comments

The test code: p @imageService.images.public

Error as below: Error: test_cinder_backups_all(Debug): NoMethodError: undefined method is_public' for <Fog::Image::OpenStack::V2::Image:0x000000035002c8> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/fog-openstack-0.1.17/lib/fog/image/openstack/v2/models/image.rb:52:in method_missing' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/fog-openstack-0.1.17/lib/fog/image/openstack/v2/models/images.rb:27:in block in public' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/fog-core-1.43.0/lib/fog/core/collection.rb:19:in delete_if' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/fog-core-1.43.0/lib/fog/core/collection.rb:19:in delete_if' C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/fog-openstack-0.1.17/lib/fog/image/openstack/v2/models/images.rb:27:in public' Debug.rb:58:in `test_cinder_backups_all' 55: #p @imageService.images.all 56: #p @imageService.images.summary 57: # p @imageService.images.private => 58: p @imageService.images.public 59: end 60: 61:

Anybody who knows the reason,thanks.

zhoutiekui avatar Nov 29 '16 11:11 zhoutiekui

good point, it is most likely a copy & paste error here: https://github.com/fog/fog-openstack/blob/master/lib/fog/image/openstack/v2/models/images.rb#L29

is_public is a v1 method, this should use visibility instead

If you would like to provide a fixing pull request, I'm happy to review.

Carthaca avatar Jan 30 '17 13:01 Carthaca

Hey, I created a PR here for this issue. Appreciate any feedback: https://github.com/fog/fog-openstack/pull/282

shaneboulden avatar Mar 26 '17 00:03 shaneboulden