Bug 1455563 - Accessing the 'container_service_port_configs' association of a MiqAeServiceContainerService object gives an error
Summary: Accessing the 'container_service_port_configs' association of a MiqAeServiceC...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.8.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: GA
: 5.8.4
Assignee: Greg McCullough
QA Contact: Shalom Naim
URL:
Whiteboard: container:automate
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-25 13:24 UTC by Peter McGowan
Modified: 2019-08-06 20:06 UTC (History)
10 users (show)

Fixed In Version: 5.8.1.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-06-29 15:10:41 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Peter McGowan 2017-05-25 13:24:53 UTC
Description of problem:
Accessing the 'container_service_port_configs' association of a MiqAeServiceContainerService object gives an 'uninitialized constant MiqAeMethodService::MiqAeServiceContainerServicePortConfig' error

Version-Release number of selected component (if applicable):
5.8.0.16.20170522163900_28fa952

How reproducible:
Every time

Steps to Reproduce:
In rails console: 
1. a = $evm.vmdb(:container_service).all.first
2. a.associations
3. a.container_service_port_configs

Actual results:
NameError: uninitialized constant MiqAeMethodService::MiqAeServiceContainerServicePortConfig
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:132:in `const_get'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:132:in `block in wrap_results'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:285:in `ar_method'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:128:in `wrap_results'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:130:in `block (2 levels) in wrap_results'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.3/lib/active_record/relation/delegation.rb:40:in `collect'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.3/lib/active_record/relation/delegation.rb:40:in `collect'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:130:in `block in wrap_results'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:285:in `ar_method'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:128:in `wrap_results'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:141:in `wrap_results'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:121:in `block (2 levels) in expose'
	from (irb):6
	from /opt/rh/cfme-gemset/gems/railties-5.0.3/lib/rails/commands/console.rb:65:in `start'
	from /opt/rh/cfme-gemset/gems/railties-5.0.3/lib/rails/commands/console_helper.rb:9:in `start'
	from /opt/rh/cfme-gemset/gems/railties-5.0.3/lib/rails/commands/commands_tasks.rb:78:in `console'
	from /opt/rh/cfme-gemset/gems/railties-5.0.3/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
	from /opt/rh/cfme-gemset/gems/railties-5.0.3/lib/rails/commands.rb:18:in `<top (required)>'
	from bin/rails:4:in `require'
	from bin/rails:4:in `<main>'


Expected results:
The association should be traversed

Additional info:
Looks like there's no MiqAeServiceContainerServicePortConfig service model. Possibly confused by the fact that there are both ContainerPortConfig and ContainerServicePortConfig AR models, the MiqAeServiceContainerPortConfig service model does exist, the MiqAeServiceContainerServicePortConfig service model is missing.

Comment 11 CFME Bot 2017-06-12 15:16:18 UTC
New commit detected on ManageIQ/manageiq/fine:
https://github.com/ManageIQ/manageiq/commit/c5090b2ed16feab699b1f46a1385b37b7176c083

commit c5090b2ed16feab699b1f46a1385b37b7176c083
Author:     Kenneth D. Evensen <kevensen>
AuthorDate: Thu May 25 20:51:25 2017 -0400
Commit:     Kenneth D. Evensen <kevensen>
CommitDate: Tue May 30 18:21:47 2017 -0400

    Cleaning up container service model exposures.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1455563

 .../service_models/miq_ae_service_container_build.rb              | 1 -
 .../service_models/miq_ae_service_container_build_pod.rb          | 1 -
 .../service_models/miq_ae_service_container_group.rb              | 1 -
 .../service_models/miq_ae_service_container_node.rb               | 1 -
 .../service_models/miq_ae_service_container_quota_item.rb         | 4 ++++
 .../service_models/miq_ae_service_container_replicator.rb         | 2 --
 .../service_models/miq_ae_service_container_route.rb              | 1 -
 .../service_models/miq_ae_service_container_service.rb            | 1 -
 ...geiq-providers-kubernetes-container_manager-container_group.rb | 2 +-
 .../service_models/miq_ae_service_security_context.rb             | 4 ++++
 .../service_models/miq_ae_service_container_group_spec.rb         | 4 ----
 .../service_models/miq_ae_service_container_node_spec.rb          | 4 ----
 .../service_models/miq_ae_service_container_replicator_spec.rb    | 8 --------
 .../service_models/miq_ae_service_container_route_spec.rb         | 4 ----
 .../service_models/miq_ae_service_container_service_spec.rb       | 4 ----
 15 files changed, 9 insertions(+), 33 deletions(-)
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_container_quota_item.rb
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_security_context.rb

Comment 12 Ken Evensen 2017-06-26 13:18:28 UTC
Merged with pull request https://github.com/ManageIQ/manageiq/pull/15235

Comment 13 Einat Pacifici 2017-07-03 10:50:13 UTC
Still fails with the same error as in description. 

See: 
http://pastebin.test.redhat.com/499742

Comment 15 Ken Evensen 2017-07-12 22:37:13 UTC
Oversight on my part.  Fixed in pull request https://github.com/ManageIQ/manageiq/pull/15562.

Comment 16 Ken Evensen 2017-07-15 17:10:25 UTC
Please disregard Comment 15 for a moment.  In my recent pull from the FINE branch, I did not run into this error.  I executed the following:

bin/rails c
irb(main):001:0> $evm = MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new)
irb(main):001:0> a = $evm.vmdb(:container_service).all.first
irb(main):001:0> a.associations
irb(main):001:0> a.container_service_port_configs


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