Bug 1200601

Summary: [RFE] Please expose pxe_image_type to AeService Models
Product: Red Hat CloudForms Management Engine Reporter: Kevin Morey <kmorey>
Component: AutomateAssignee: Lucy Fu <lufu>
Status: CLOSED ERRATA QA Contact: Dave Johnson <dajohnso>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.3.0CC: david.costakos, jhardy, kmorey, mberube, mfeifer, mkanoor, obarenbo, psavage, ssainkar, tfitzger
Target Milestone: GAKeywords: FutureFeature
Target Release: 5.4.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
This version of CloudForms Management Engine exposes PxeImageType to automate. This enables customers to organize their customization templates they use for each tenant.
Story Points: ---
Clone Of:
: 1207796 (view as bug list) Environment:
Last Closed: 2015-06-16 12:52:08 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1207796    

Description Kevin Morey 2015-03-10 23:14:07 UTC
Description of problem:
When trying to query the pxe_image_type in automate we do not see the folders that cloud-init, sysprep and kickstart scripts are kept in. Here is the use case:

Say a customer wants to organize their customization templates they use for each tenant. In automate they then want to look for all cloud-init scripts in a customers folder. Today there is no mechanism to tag a customization template and without some kind of naming convention for each customziation_template I cannot determine which script belongs to who?

I thought i opened a FogBug on this way back in the MIQ days but i guess it got dropped. 


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

How reproducible:
always

Steps to Reproduce:
1. from the rails console
2. $evm = MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new)
3. pit = $evm.vmdb(:pxe_image_type).first
pi = $evm.vmdb(:pxe_image_type).all
NameError: uninitialized constant MiqAeMethodService::MiqAeServicePxeImageType
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service.rb:207:in `const_get'
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service.rb:207:in `vmdb'
	from (irb):23
	from /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.17/lib/rails/commands/console.rb:47:in `start'
	from /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.17/lib/rails/commands/console.rb:8:in `start'
	from /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.17/lib/rails/commands.rb:41:in `<top (required)>'
	from script/rails:6:in `require'
	from script/rails:6:in `<main>'

4. p = PxeImageType.last
   PxeImageType.last
  PxeImageType Load (7.5ms)  SELECT "pxe_image_types".* FROM "pxe_image_types" ORDER BY "pxe_image_types"."id" DESC LIMIT 1
  PxeImageType Inst (0.1ms - 1rows)
=> #<PxeImageType id: 360000000000005, name: "Amazon", provision_type: "">

So you see?  You cannot look up pxe_image_types via the AeServiceModel.

Comment 2 CFME Bot 2015-03-30 20:21:08 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/6b12f0f81baef8252ecdd6ac5a1019fbbd80597c

commit 6b12f0f81baef8252ecdd6ac5a1019fbbd80597c
Author:     Lucy Fu <lufu>
AuthorDate: Mon Mar 30 11:25:04 2015 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Mon Mar 30 11:43:13 2015 -0400

    Expose PxeImageType to automate.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1200601

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

Comment 3 CFME Bot 2015-04-02 14:45:49 UTC
New commit detected on cfme/5.3.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=52c8f5ca46a7f443b3067be002b0ccd53d43d4a5

commit 52c8f5ca46a7f443b3067be002b0ccd53d43d4a5
Author:     Lucy Fu <lufu>
AuthorDate: Mon Mar 30 11:25:04 2015 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Tue Mar 31 14:01:39 2015 -0400

    Expose PxeImageType to automate.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1200601

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

Comment 5 Pete Savage 2015-04-28 10:11:52 UTC
Verified in 5.4.0.0.22.20150420163946

Comment 7 errata-xmlrpc 2015-06-16 12:52:08 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