Bug 1104133

Summary: undefined method variable "subscription_manager_configuration_url"
Product: Red Hat Satellite Reporter: Martin Korbel <mkorbel>
Component: ProvisioningAssignee: Dustin Tsang <dtsang>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Korbel <mkorbel>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.3CC: bbuckingham, cwelton, dlobatog, dtsang, jhutar, jmontleo, mmccune, sthirugn, tkolhar
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/6826
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-11 12:24:10 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
traceback none

Description Martin Korbel 2014-06-03 10:57:25 UTC
Created attachment 901757 [details]
traceback

Description of problem:
When I try to create a EC2 guests using Sat6, I get this error in production.log and guest is not registered.


Prepare post installation script for ggg.test.example.com task failed with the following error: undefined method `subscription_manager_configuration_url' for #<Host::Managed:0x007f065c9f1d98>/opt/rh/ruby193/root/usr/share/gems/gems/activemodel-3.2.8/lib/active_model/attribute_methods.rb:407:in `method_missing'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods.rb:149:in `method_missing'
/opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode/scope.rb:37:in `method_missing'

<< the complete traceback is in the attachment >>

Version-Release number of selected component (if applicable):
Satellite-6.0.3-RHEL-6-20140528.4

How reproducible:
100%

Steps to Reproduce:
1. We have got Sat6 with EC2 compute resource.
2. We have got this line in our finish template
> <%= snippets "subscription_manager_registration" %>
3. We can try create new host, but registration fails with the traceback in log.


Snippet "subscription_manager_registration" contains this row.
> rpm -ivh <%= subscription_manager_configuration_url %>


One thing is interesting, When we open a detail of guest ("Hosts" > "All hosts" > our new guest > "Templates" > our finish template > "Review"), the expansion of the variable "subscription_manager_configuration_url" is correct
> rpm -ivh http://sat.eu-west-1.compute.internal/pub/katello-ca-consumer-latest.noarch.rpm

When We replace the variable "subscription_manager_configuration_url" with link "http://sat.eu-west-1.compute.internal/pub/katello-ca-consumer-latest.noarch.rpm" in the snippet, the registration ends fine.

Actual results:
Traceback, system is not registered.

Expected results:
System is registered.

Additional info:

Comment 1 RHEL Program Management 2014-06-03 11:15:35 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Martin Korbel 2014-06-04 09:09:22 UTC
Next interesting thing is it, when We use "subscription_manager_registration" in user_data template (for cloud-init), We get this error in WebUI (when We try create new guest). It is difference between user_data (cloud-init) and finish (ssh) templates.

Render user data template for ggg.test.example.com task failed with the following error: undefined method `subscription_manager_configuration_url' for #<Host::Managed:0x0000000fc15ef8>

Comment 4 Dustin Tsang 2014-07-29 21:25:51 UTC
Created redmine issue http://projects.theforeman.org/issues/6826 from this bug

Comment 8 Daniel Lobato Garcia 2014-09-02 11:56:48 UTC
DEVELOPER VERIFIED: Registration worked successfully with this variable on user_data and finish templates.

Comment 10 Martin Korbel 2014-09-04 14:08:00 UTC
VERIFIED on Satellite-6.0.4-RHEL-6-20140829.0

Comment 11 Bryan Kearney 2014-09-11 12:24:10 UTC
This was delivered with Satellite 6.0 which was released on 10 September 2014.