Bug 1281585 - Unable to list cloud networks in automate
Summary: Unable to list cloud networks in automate
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.5.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.5.0
Assignee: mkanoor
QA Contact: Alex Newman
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-12 21:01 UTC by Brandon Johnson
Modified: 2015-12-08 13:47 UTC (History)
9 users (show)

Fixed In Version: 5.5.0.11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-08 13:47:01 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 RHSA-2015:2551 0 normal SHIPPED_LIVE Moderate: CFME 5.5.0 bug fixes and enhancement update 2015-12-08 17:58:09 UTC

Description Brandon Johnson 2015-11-12 21:01:42 UTC
Description of problem:
running $evm.vmdb(:cloud_network).all in automate (or rails console) errors:
irb(main):002:0> $evm.vmdb(:cloud_network).all
  CloudNetwork Inst Including Associations (215.3ms - 57rows)
NameError: uninitialized constant MiqAeMethodService::MiqAeServiceManageIQ_Providers_Openstack_CloudManager_CloudNetwork_Private
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:116:in `const_get'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:116:in `block in wrap_results'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:261:in `ar_method'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:108:in `wrap_results'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:114:in `block (2 levels) in wrap_results'
	from /opt/rh/cfme-gemset/bundler/gems/rails-a37d0e57571f/activerecord/lib/active_record/relation/delegation.rb:46:in `collect'
	from /opt/rh/cfme-gemset/bundler/gems/rails-a37d0e57571f/activerecord/lib/active_record/relation/delegation.rb:46:in `collect'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:114:in `block in wrap_results'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:261:in `ar_method'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:108:in `wrap_results'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:19:in `method_missing'
	from (irb):2
	from /opt/rh/cfme-gemset/bundler/gems/rails-a37d0e57571f/railties/lib/rails/commands/console.rb:110:in `start'
	from /opt/rh/cfme-gemset/bundler/gems/rails-a37d0e57571f/railties/lib/rails/commands/console.rb:9:in `start'
	from /opt/rh/cfme-gemset/bundler/gems/rails-a37d0e57571f/railties/lib/rails/commands/commands_tasks.rb:68:in `console'
	from /opt/rh/cfme-gemset/bundler/gems/rails-a37d0e57571f/railties/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
	from /opt/rh/cfme-gemset/bundler/gems/rails-a37d0e57571f/railties/lib/rails/commands.rb:17:in `<top (required)>'
	from bin/rails:4:in `require'
	from bin/rails:4:in `<main>'irb(main):003:0>



Version-Release number of selected component (if applicable):
5.5.0.9 (CF 4.0 Beta2)

How reproducible:
everytime

Steps to Reproduce:
1. run $evm.vmdb(:cloud_network).all in an automate method or from the rails console
2.
3.

Actual results:


Expected results:
list cloud networks that cloudforms has discovered


Additional info:
Tested and worked in 5.4

Comment 2 Greg McCullough 2015-11-13 13:10:51 UTC
PR https://github.com/ManageIQ/manageiq/pull/4532 added the following sub-classed network models that need to be added to the automate service model:

ManageIQ::Providers::Openstack::InfraManager::CloudNetwork::Private
ManageIQ::Providers::Openstack::InfraManager::CloudNetwork::Public
ManageIQ::Providers::Openstack::InfraManager::CloudNetwork::Private
ManageIQ::Providers::Openstack::InfraManager::CloudNetwork::Public

Comment 5 CFME Bot 2015-11-16 20:00:42 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/24d2d00bbf939dcc9fb23913e14d2f005711a83c

commit 24d2d00bbf939dcc9fb23913e14d2f005711a83c
Author:     Madhu Kanoor <mkanoor>
AuthorDate: Fri Nov 13 16:13:35 2015 -0500
Commit:     Madhu Kanoor <mkanoor>
CommitDate: Mon Nov 16 11:24:16 2015 -0500

    Added missing service models for cloud network
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1281585

 app/models/manageiq/providers/openstack/cloud_manager.rb  |  1 +
 .../providers/openstack/cloud_manager/cloud_network.rb    |  2 ++
 .../providers/openstack/infra_manager/cloud_network.rb    |  2 ++
 ...iders-openstack-cloud_manager-cloud_network-private.rb |  4 ++++
 ...viders-openstack-cloud_manager-cloud_network-public.rb |  4 ++++
 ...eiq-providers-openstack-cloud_manager-cloud_network.rb |  4 ++++
 ...iders-openstack-infra_manager-cloud_network-private.rb |  4 ++++
 ...viders-openstack-infra_manager-cloud_network-public.rb |  4 ++++
 ...eiq-providers-openstack-infra_manager-cloud_network.rb |  4 ++++
 spec/lib/miq_automation_engine/miq_ae_service_spec.rb     | 15 +++++++++++++++
 10 files changed, 44 insertions(+)
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-openstack-cloud_manager-cloud_network-private.rb
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-openstack-cloud_manager-cloud_network-public.rb
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-openstack-cloud_manager-cloud_network.rb
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-openstack-infra_manager-cloud_network-private.rb
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-openstack-infra_manager-cloud_network-public.rb
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-openstack-infra_manager-cloud_network.rb

Comment 6 CFME Bot 2015-11-16 23:07:20 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=ac7b1e3faea7782638ab2901445bcbc155a72a49

commit ac7b1e3faea7782638ab2901445bcbc155a72a49
Author:     Madhu Kanoor <mkanoor>
AuthorDate: Fri Nov 13 16:13:35 2015 -0500
Commit:     Madhu Kanoor <mkanoor>
CommitDate: Mon Nov 16 15:34:30 2015 -0500

    Added missing service models for cloud network
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1281585

 app/models/manageiq/providers/openstack/cloud_manager.rb  |  1 +
 .../providers/openstack/cloud_manager/cloud_network.rb    |  2 ++
 .../providers/openstack/infra_manager/cloud_network.rb    |  2 ++
 ...iders-openstack-cloud_manager-cloud_network-private.rb |  4 ++++
 ...viders-openstack-cloud_manager-cloud_network-public.rb |  4 ++++
 ...eiq-providers-openstack-cloud_manager-cloud_network.rb |  4 ++++
 ...iders-openstack-infra_manager-cloud_network-private.rb |  4 ++++
 ...viders-openstack-infra_manager-cloud_network-public.rb |  4 ++++
 ...eiq-providers-openstack-infra_manager-cloud_network.rb |  4 ++++
 spec/lib/miq_automation_engine/miq_ae_service_spec.rb     | 15 +++++++++++++++
 10 files changed, 44 insertions(+)
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-openstack-cloud_manager-cloud_network-private.rb
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-openstack-cloud_manager-cloud_network-public.rb
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-openstack-cloud_manager-cloud_network.rb
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-openstack-infra_manager-cloud_network-private.rb
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-openstack-infra_manager-cloud_network-public.rb
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-openstack-infra_manager-cloud_network.rb

Comment 7 CFME Bot 2015-11-16 23:07:25 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=8e8b2e46efe6cc8b9ced4f23a7e1bf748ee84d6a

commit 8e8b2e46efe6cc8b9ced4f23a7e1bf748ee84d6a
Merge: bb22b46 ac7b1e3
Author:     Oleg Barenboim <obarenbo>
AuthorDate: Mon Nov 16 17:35:04 2015 -0500
Commit:     Oleg Barenboim <obarenbo>
CommitDate: Mon Nov 16 17:35:04 2015 -0500

    Merge branch 'bugzilla_1281585_gm_5_5_z' into '5.5.z'
    
    Added missing service models for cloud network
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1281585
    
    Original PR https://github.com/ManageIQ/manageiq/pull/5458
    
    Clean Cherry Pick
    
    Depends on MR http://gitlab.cloudforms.lab.eng.rdu2.redhat.com/cloudforms/cfme/merge_requests/474
    
    See merge request !475

 app/models/manageiq/providers/openstack/cloud_manager.rb  |  1 +
 .../providers/openstack/cloud_manager/cloud_network.rb    |  2 ++
 .../providers/openstack/infra_manager/cloud_network.rb    |  2 ++
 ...iders-openstack-cloud_manager-cloud_network-private.rb |  4 ++++
 ...viders-openstack-cloud_manager-cloud_network-public.rb |  4 ++++
 ...eiq-providers-openstack-cloud_manager-cloud_network.rb |  4 ++++
 ...iders-openstack-infra_manager-cloud_network-private.rb |  4 ++++
 ...viders-openstack-infra_manager-cloud_network-public.rb |  4 ++++
 ...eiq-providers-openstack-infra_manager-cloud_network.rb |  4 ++++
 spec/lib/miq_automation_engine/miq_ae_service_spec.rb     | 15 +++++++++++++++
 10 files changed, 44 insertions(+)

Comment 8 Alex Newman 2015-11-20 19:18:59 UTC
Tested Version:5.5.0.11-rc1.20151117182049_653c0d4 

How to test:
SSH into appliance
execute 'vmdb'
execute 'bundle exec bin/rails c'
execute '$evm = MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new)'
execute '$evm.vmdb(:cloud_network).all'

Test:
irb(main):004:0> $evm = MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new)
=> #<MiqAeMethodService::MiqAeService:0x0000000247e5d0 @drb_server_references=[], @inputs={}, @workspace=#<MiqAeEngine::MiqAeWorkspaceRuntime:0x0000000247e918 @readonly=false, @nodes=[], @current=[], @num_drb_methods=0, @datastore_cache={}, @class_methods={}, @dom_search=#<MiqAeEngine::MiqAeDomainSearch:0x0000000247e788 @fqns_id_cache={}, @fqns_id_class_cache={}, @partial_ns=[]>, @persist_state_hash={}, @current_state_info={}, @state_machine_objects=[], @ae_user=nil>, @preamble_lines=0, @body=[], @persist_state_hash={}>
irb(main):005:0> $evm.vmdb(:cloud_network).all
  CloudNetwork Inst Including Associations (0.0ms - 0rows)
=> []

Comment 10 errata-xmlrpc 2015-12-08 13:47:01 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/RHSA-2015:2551


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