Bug 1338628 - Accessing the 'cloud_subnet' and 'cloud_network' associations of a MiqAeServiceManageIQ_Providers_Openstack_NetworkManager_NetworkPort object gives a 'NoMethodError'
Summary: Accessing the 'cloud_subnet' and 'cloud_network' associations of a MiqAeServi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: GA
: 5.6.0
Assignee: Lucy Fu
QA Contact: Dmitry Misharov
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-23 07:24 UTC by Peter McGowan
Modified: 2018-06-25 14:55 UTC (History)
6 users (show)

Fixed In Version: 5.6.0.8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-29 16:05:07 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1348 0 normal SHIPPED_LIVE CFME 5.6.0 bug fixes and enhancement update 2016-06-29 18:50:04 UTC

Description Peter McGowan 2016-05-23 07:24:14 UTC
Description of problem:
Accessing the 'cloud_subnet' and 'cloud_network' associations of a MiqAeServiceManageIQ_Providers_Openstack_NetworkManager_NetworkPort object gives a 'NoMethodError'

Version-Release number of selected component (if applicable):
darga-1-rc1.1.20160523065746_af35a03 

How reproducible:
Every time

Steps to Reproduce:
1. Locate an MiqAeServiceManageIQ_Providers_Openstack_NetworkManager_NetworkPort either programmatically or in the Rails Console
2. List the associations: @associations=["cloud_network", "cloud_subnet", "cloud_tenant", "device", "ext_management_system"]>
3. Try to access the 'cloud_subnet' or 'cloud_network' associations

Actual results:
irb(main):008:0> port.cloud_network
NoMethodError: undefined method `cloud_network' for #<ManageIQ::Providers::Openstack::NetworkManager::NetworkPort:0x00000002e95b18>
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/activemodel-5.0.0.rc1/lib/active_model/attribute_methods.rb:433:in `method_missing'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:263:in `block in object_send'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:282:in `ar_method'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:292:in `ar_method'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:261:in `object_send'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:122:in `block (2 levels) in expose'
	from (irb):8
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc1/lib/rails/commands/console.rb:65:in `start'
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc1/lib/rails/commands/console_helper.rb:9:in `start'
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc1/lib/rails/commands/commands_tasks.rb:78:in `console'
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc1/lib/rails/commands.rb:18:in `<top (required)>'
	from bin/rails:4:in `require'
	from bin/rails:4:in `<main>'
irb(main):009:0> port.cloud_subnet
NoMethodError: undefined method `cloud_subnet' for #<ManageIQ::Providers::Openstack::NetworkManager::NetworkPort:0x00000002e95b18>
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/activemodel-5.0.0.rc1/lib/active_model/attribute_methods.rb:433:in `method_missing'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:263:in `block in object_send'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:282:in `ar_method'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:292:in `ar_method'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:261:in `object_send'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:122:in `block (2 levels) in expose'
	from (irb):9
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc1/lib/rails/commands/console.rb:65:in `start'
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc1/lib/rails/commands/console_helper.rb:9:in `start'
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc1/lib/rails/commands/commands_tasks.rb:78:in `console'
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc1/lib/rails/commands.rb:18:in `<top (required)>'
	from bin/rails:4:in `require'
	from bin/rails:4:in `<main>'

Expected results:
No error

Additional info:

Comment 3 CFME Bot 2016-05-24 14:06:42 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/84a8e792d9414b65b2affdb56e8783088e649d6c

commit 84a8e792d9414b65b2affdb56e8783088e649d6c
Author:     Lucy Fu <lufu>
AuthorDate: Mon May 23 13:06:43 2016 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Mon May 23 13:07:16 2016 -0400

    Expose the associations of ManageIQ::Providers::Openstack::NetworkManager::NetworkPort to automate.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1338628

 ...rvice_manageiq-providers-openstack-network_manager-network_port.rb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comment 4 Milan Falešník 2016-05-31 09:14:32 UTC
Verified in 5.6.0.8

p = $evm.vmdb(:ExtManagementSystem).find_by_guid(guid)
port = p.network_manager.network_ports.last
irb(main):014:0> port.cloud_subnets
=> [#<MiqAeServiceManageIQ_Providers_Openstack_NetworkManager_CloudSubnet:0x4f00b0 @object=..., @virtual_columns=["allocation_pools", "dns_nameservers_show", "host_routes", "ip_version", "region_description", "region_number", "subnetpool_id", "total_vms"], @associations=["availability_zone", "cloud_network", "vms"]>]
irb(main):015:0> port.network_routers
=> []
irb(main):016:0> port.public_networks
=> []

Comment 6 errata-xmlrpc 2016-06-29 16:05:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1348


Note You need to log in before you can comment on or make changes to this bug.