Bug 1382060

Summary: Redefining `object_id' may cause serious problems
Product: Red Hat CloudForms Management Engine Reporter: John Prause <jprause>
Component: ProvidersAssignee: Gilles Dubreuil <gdubreui>
Status: CLOSED CURRENTRELEASE QA Contact: Oleksandr Kolisnyk <okolisny>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.6.0CC: abraverm, cpelland, gdubreui, jfrey, jhardy, lsmola, obarenbo, okolisny, rrasouli, simaishi
Target Milestone: GAKeywords: TestOnly
Target Release: 5.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.8.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1396242 (view as bug list) Environment:
Last Closed: 2017-06-12 17:09:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Openstack Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1396242    

Description John Prause 2016-10-05 15:52:33 UTC
A question came into talk.manageiq.org regarding Openstack.
After reviewing logs, this was found and Ladas asked for a BZ to track:

[----] I, [2016-09-27T04:01:46.282558 #21144:11a998c] INFO -- : MIQ(MiqEventHandler::Runner#message_sync_active_roles) MIQ(MiqEventHandler::Runner) Synchronizing active roles complete...
/opt/rh/cfme-gemset/gems/fog-core-1.42.0/lib/fog/core/attributes/default.rb:52: warning: redefining `object_id' may cause serious problems

Here is the link to the talk issue and the logs:
http://talk.manageiq.org/t/openstack-sync-fail/1751/7

Comment 5 Gilles Dubreuil 2016-10-27 09:27:14 UTC
The object_id attribute is created by default for every model. By adding the object_id again in the attribute list for the model overrides an already existing #method which triggers a Ruby warning.

Issue has been addressed by following Pull Request:

https://github.com/fog/fog-openstack/pull/220.

Comment 6 Gilles Dubreuil 2016-10-27 09:28:51 UTC
This has been merge to fog-openstack master branch.
It will be included in next release 0.1.17.

Comment 14 Gilles Dubreuil 2017-03-15 03:30:07 UTC
To verify, as the fix was released with fog-openstack version 0.17.0, testing any version prior will display the warning.

I suggest to test with version 0.1.15 and then compare with a later version (>= 0.1.17) to see the warning is gone:

For instance:
$ gem install fog-openstack --version 0.1.15 --no-ri --no-rdoc

$ cat > check-warning.rb <<EOF
require 'rubygems'
gem 'fog-openstack', '=0.1.15'
require 'fog/openstack'
 
network = Fog::Network::OpenStack.new({
  openstack_auth_url: "http://192.0.2.21:5000/v2.0/tokens",
  openstack_username: 'admin',
  openstack_api_key: "CJk9hb2ZFR96Ypu74KFFGWuhv"})
  
network.networks
EOF

$ irb
irb(main):001:0> load './check-warning.rb'
/home/gildub/.gem/ruby/2.3.3/gems/fog-core-1.43.0/lib/fog/core/attributes/default.rb:52: warning: redefining `object_id' may cause serious problems
=> true

$ gem install fog-openstack --version 0.1.19 --no-ri --no-rdoc

$ sed -i s/0.1.15/0.1.19/ check-warning.rb

$ irb
irb(main):001:0> load './check-warning.rb'
=> true

Comment 16 Oleksandr Kolisnyk 2017-05-25 17:31:26 UTC
Tested both fog-openstack 0.1.15 and 0.1.19 on image of CFME 5.8.0.16 (if it matters).