Bug 1280350

Summary: NameError uninitialized constant MiqAeMethodService::MiqAeServiceEmsOpenstack
Product: Red Hat CloudForms Management Engine Reporter: Greg McCullough <gmccullo>
Component: AutomateAssignee: Greg McCullough <gmccullo>
Status: CLOSED ERRATA QA Contact: Pavol Kotvan <pakotvan>
Severity: high Docs Contact:
Priority: high    
Version: 5.5.0CC: brjohnso, cpelland, david.costakos, jhardy, kmorey, mfeifer, mkanoor, obarenbo, simaishi, tfitzger
Target Milestone: GA   
Target Release: 5.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.5.0.11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-08 13:46:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Verification - Automation log
none
Verification - Screenshot - Simulation none

Description Greg McCullough 2015-11-11 14:29:54 UTC
Description of problem:
Automate method with the following line fails with error message "NameError uninitialized constant MiqAeMethodService::MiqAeServiceEmsOpenstack"
$evm.vmdb(:ems_openstack).find_by_id(provider_id)


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


How reproducible: Always


Steps to Reproduce:
1. Copy the /ManageIQ/System/Request/InspectMe method to a writable/enabled domain
2. Edit the method to contain a single line: $evm.vmdb(:ems_openstack)
3. Run /System/Request/InspectMe from Automate -> Simulation

Actual results:
ERROR -- : <AEMethod inspectme> The following error occurred during method evaluation:
ERROR -- : <AEMethod inspectme>   NameError: uninitialized constant MiqAeMethodService::MiqAeServiceEmsOpenstack


Expected results:
Method runs without error

Additional info:

[----] E, [2015-11-10T09:41:04.336182 #20255:6724b00] ERROR -- : <AEMethod list_openstack_flavors_using_openstackid> NameError uninitialized constant MiqAeMethodService::MiqAeServiceEmsOpenstack
[----] E, [2015-11-10T09:41:04.337365 #20255:6724b00] ERROR -- : <AEMethod list_openstack_flavors_using_openstackid> (druby://127.0.0.1:38694) /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service.rb:202:in `const_get'
(druby://127.0.0.1:38694) /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service.rb:202:in `vmdb'
(druby://127.0.0.1:38694) /opt/rh/rh-ruby22/root/usr/share/ruby/drb/drb.rb:1624:in `perform_without_block'
(druby://127.0.0.1:38694) /opt/rh/rh-ruby22/root/usr/share/ruby/drb/drb.rb:1584:in `perform'
(druby://127.0.0.1:38694) /opt/rh/rh-ruby22/root/usr/share/ruby/drb/drb.rb:1657:in `block (2 levels) in main_loop'
(druby://127.0.0.1:38694) /opt/rh/rh-ruby22/root/usr/share/ruby/drb/drb.rb:1653:in `loop'
(druby://127.0.0.1:38694) /opt/rh/rh-ruby22/root/usr/share/ruby/drb/drb.rb:1653:in `block in main_loop'
<code: provider = $evm.vmdb(:ems_openstack).find_by_id(provider_id)>:22:in `get_provider'
<code: provider = get_provider()>:67:in `<main>’

Comment 6 CFME Bot 2015-11-16 20:00:28 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/92ff2c3e8cff268818c8c7d66107102fe27cb00f

commit 92ff2c3e8cff268818c8c7d66107102fe27cb00f
Author:     Greg McCullough <gmccullo>
AuthorDate: Wed Nov 11 19:18:42 2015 -0500
Commit:     Greg McCullough <gmccullo>
CommitDate: Mon Nov 16 10:59:24 2015 -0500

    Allow automate methods to load service models using old model names
    
    This is required to support automate methods that access models using
    legacy provider model names which are now name-spaced.
    For example: $evm.vmdb(:ems_openstack)
    is now:      $evm.vmdb(:ManageIQ_Providers_Openstack_CloudManager)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1280350

 lib/miq_automation_engine/engine/miq_ae_service.rb |  15 +++-
 .../engine/miq_ae_service_model_legacy.rb          | 100 +++++++++++++++++++++
 .../miq_automation_engine/miq_ae_service_spec.rb   |  40 +++++++++
 3 files changed, 151 insertions(+), 4 deletions(-)
 create mode 100644 lib/miq_automation_engine/engine/miq_ae_service_model_legacy.rb

Comment 7 CFME Bot 2015-11-16 20:00:35 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/e2b18ef05bdf1f825621a1431216641c38cf6271

commit e2b18ef05bdf1f825621a1431216641c38cf6271
Author:     Greg McCullough <gmccullo>
AuthorDate: Thu Nov 12 16:51:41 2015 -0500
Commit:     Greg McCullough <gmccullo>
CommitDate: Mon Nov 16 10:59:26 2015 -0500

    Fix provider service model inheritance
    Discovered ConfigurationManager and ProvisioningManager service models were not properly converted to pluggable provider name-spacing.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1280350

 .../service_models/miq_ae_service_configuration_manager.rb         | 7 -------
 .../miq_ae_service_manageiq-providers-configuration_manager.rb     | 7 +++++++
 .../miq_ae_service_manageiq-providers-provisioning_manager.rb      | 7 +++++++
 .../service_models/miq_ae_service_provisioning_manager.rb          | 7 -------
 spec/lib/miq_automation_engine/miq_ae_service_spec.rb              | 6 ++++++
 5 files changed, 20 insertions(+), 14 deletions(-)
 delete mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_configuration_manager.rb
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-configuration_manager.rb
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-provisioning_manager.rb
 delete mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_provisioning_manager.rb

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

commit 8e12a678fa14e7e2a35ab9c27ba28b97be65c75d
Author:     Greg McCullough <gmccullo>
AuthorDate: Wed Nov 11 19:18:42 2015 -0500
Commit:     Greg McCullough <gmccullo>
CommitDate: Mon Nov 16 15:17:23 2015 -0500

    Allow automate methods to load service models using old model names
    
    This is required to support automate methods that access models using
    legacy provider model names which are now name-spaced.
    For example: $evm.vmdb(:ems_openstack)
    is now:      $evm.vmdb(:ManageIQ_Providers_Openstack_CloudManager)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1280350

 lib/miq_automation_engine/engine/miq_ae_service.rb |  15 +++-
 .../engine/miq_ae_service_model_legacy.rb          | 100 +++++++++++++++++++++
 .../miq_automation_engine/miq_ae_service_spec.rb   |  40 +++++++++
 3 files changed, 151 insertions(+), 4 deletions(-)
 create mode 100644 lib/miq_automation_engine/engine/miq_ae_service_model_legacy.rb

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

commit a2695b726d6750665bdd85c2be4c633a25273189
Author:     Greg McCullough <gmccullo>
AuthorDate: Thu Nov 12 16:51:41 2015 -0500
Commit:     Greg McCullough <gmccullo>
CommitDate: Mon Nov 16 15:18:23 2015 -0500

    Fix provider service model inheritance
    Discovered ConfigurationManager and ProvisioningManager service models were not properly converted to pluggable provider name-spacing.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1280350

 .../service_models/miq_ae_service_configuration_manager.rb         | 7 -------
 .../miq_ae_service_manageiq-providers-configuration_manager.rb     | 7 +++++++
 .../miq_ae_service_manageiq-providers-provisioning_manager.rb      | 7 +++++++
 .../service_models/miq_ae_service_provisioning_manager.rb          | 7 -------
 spec/lib/miq_automation_engine/miq_ae_service_spec.rb              | 6 ++++++
 5 files changed, 20 insertions(+), 14 deletions(-)
 delete mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_configuration_manager.rb
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-configuration_manager.rb
 create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-provisioning_manager.rb
 delete mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_provisioning_manager.rb

Comment 10 Pavol Kotvan 2015-11-25 13:31:44 UTC
Created attachment 1098821 [details]
Verification - Automation log

Comment 11 Pavol Kotvan 2015-11-25 13:32:39 UTC
Created attachment 1098823 [details]
Verification - Screenshot - Simulation

Comment 12 Pavol Kotvan 2015-11-25 13:34:05 UTC
Verified against 5.5.0.12-rc2.20151124135609_653c0d4.

Comment 14 errata-xmlrpc 2015-12-08 13:46:19 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