Bug 1215812 - Calling prov.vm.scan is failing with uninitialized constant error
Summary: Calling prov.vm.scan is failing with uninitialized constant error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.3.0
Hardware: All
OS: All
unspecified
medium
Target Milestone: GA
: 5.4.0
Assignee: Lucy Fu
QA Contact: Milan Falešník
URL:
Whiteboard:
Depends On:
Blocks: 1216139
TreeView+ depends on / blocked
 
Reported: 2015-04-27 19:34 UTC by Josh Carter
Modified: 2019-07-11 09:02 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1216139 (view as bug list)
Environment:
Last Closed: 2015-06-16 13:00:20 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-2015:1100 0 normal SHIPPED_LIVE CFME 5.4.0 bug fixes, and enhancement update 2015-06-16 16:28:42 UTC

Description Josh Carter 2015-04-27 19:34:19 UTC
Description of problem:

The scan is successful but whats being returned is creating a error message. 

      begin
        prov = $evm.root['miq_provision'] || $evm.root['miq_provision_request'] || $evm.root['miq_provision_request_template']
        vm = $evm.root['vm'] || prov.vm
        vm.scan
      rescue
        log(:error, "[#{err}]\n#{err.backtrace.join("\n")}")
        # Don't stop state machine if smart scan errored.
        exit MIQ_OK
      end
     

[----] I, [2015-04-21T17:12:17.873939 #5635:85bb604]  INFO -- : Q-task_id([miq_provision_33000000000076]) Job created: guid: [90454310-e849-11e4-862e-0050569324bf], userid: [system], name: [Scan from Vm hamdev38], target class: [VmOrTemplate], target id: [33000000000052], process type: [VmScan], agent class: [], agent id: [], zone: [default]
[----] I, [2015-04-21T17:12:17.879584 #5635:85bb604]  INFO -- : Q-task_id([miq_provision_33000000000076]) dispatch_start: Dispatch Status is 'pending'
[----] E, [2015-04-21T17:12:17.884442 #5635:85bb604] ERROR -- : Q-task_id([miq_provision_33000000000076]) <AutomationEngine> MiqAeServiceModelBase.ar_method raised: <NameError>: <uninitialized constant MiqAeMethodService::MiqAeServiceVmScan>
[----] E, [2015-04-21T17:12:17.884599 #5635:85bb604] ERROR -- : Q-task_id([miq_provision_33000000000076]) <AutomationEngine> /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:107:in `const_get'

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

How reproducible:
very


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Greg McCullough 2015-04-27 20:12:21 UTC
Lucy - The service model for VmScan is missing for automate.  This model is sub-classed from the Job model which is already an automate service model.

Comment 3 CFME Bot 2015-04-27 22:05:53 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/b9ff1547539c0ff070d01d7ef1e52b5032ef1618

commit b9ff1547539c0ff070d01d7ef1e52b5032ef1618
Author:     Lucy Fu <lufu>
AuthorDate: Mon Apr 27 16:58:51 2015 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Mon Apr 27 16:58:51 2015 -0400

    Add service model for VmScan in to automate.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1215812

 .../miq_automation_engine/service_models/miq_ae_service_vm_scan.rb    | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 vmdb/lib/miq_automation_engine/service_models/miq_ae_service_vm_scan.rb

Comment 4 CFME Bot 2015-04-28 17:06:06 UTC
New commit detected on cfme/5.3.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=116ab4d6e44815eb1b88e5c76d1e9d9c8c372002

commit 116ab4d6e44815eb1b88e5c76d1e9d9c8c372002
Author:     Lucy Fu <lufu>
AuthorDate: Mon Apr 27 16:58:51 2015 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Tue Apr 28 11:12:33 2015 -0400

    Add service model for VmScan in to automate.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1215812

 .../miq_automation_engine/service_models/miq_ae_service_vm_scan.rb    | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 vmdb/lib/miq_automation_engine/service_models/miq_ae_service_vm_scan.rb

Comment 5 CFME Bot 2015-04-28 17:06:09 UTC
New commit detected on cfme/5.3.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=47201d5b030f9c8b3750a6851f9cc5f468a9ae2c

commit 47201d5b030f9c8b3750a6851f9cc5f468a9ae2c
Merge: 2e04074 116ab4d
Author:     Greg McCullough <gmccullo>
AuthorDate: Tue Apr 28 13:02:13 2015 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Tue Apr 28 13:02:13 2015 -0400

    Merge branch 'expose_vm_scan_to_automate_1216139' into '5.3.z'
    
    Add service model for VmScan in to automate.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1215812
    Upstream PR https://github.com/ManageIQ/manageiq/pull/2761
    
    See merge request !38

 .../miq_automation_engine/service_models/miq_ae_service_vm_scan.rb    | 4 ++++
 1 file changed, 4 insertions(+)

Comment 7 Milan Falešník 2015-05-15 09:33:43 UTC
Verified in 5.4.0.1, I was able to launch vm scan from the automation model in postprovision step.

Comment 9 errata-xmlrpc 2015-06-16 13:00:20 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://rhn.redhat.com/errata/RHBA-2015-1100.html


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