Bug 869758

Summary: custom repos available at install time containing var (ie $basearch)
Product: [Retired] Beaker Reporter: MikeBoswell <mboswell>
Component: schedulerAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: Qixiang Wan <qwan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.9CC: asaha, bhu, bpeck, davids, dcallagh, jburke, jstancek, mishin, qwan, rglasz, rmancy, santiago
Target Milestone: 0.11   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard: Kickstart
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 880039 (view as bug list) Environment:
Last Closed: 2013-01-17 04:35:00 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
access_log none

Description MikeBoswell 2012-10-24 18:26:46 UTC
Created attachment 632918 [details]
access_log

Description of problem:

Adding custom repos in a recipeset xml $basearch is not interpreted correclty by Beaker during install.  The resulting URL during install is invalid.
Only a problem w/ RHEL6 because of snippet used in RHEL6 kickstart template to make available custom repos during install.

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

How reproducible:
100%

Steps to Reproduce:
1. add the following line or similar containing $basearch to your recipeset
<repos>
<repo name="rt-devel" url="http://download.devel.redhat.com/rel-eng/repos/mrg-rt-2.0-rhel-6-devel/\$basearch"/>
</repos>
2. Provision RHEL 6 via Beaker
3. Provision will hang.

Actual results:
Provision will hang because of a invalid URL. Seen in the apache access_log on target web server.  (Attached)
Anaconda.log
Cannot retrieve repository metadata (repomd.xml) for repository: mrg-rhel6-optional. Please verify its path and try again 
('custom', ['_Exit installer', 'Edit', '_Retry', '_Continue']) 

Expected results:
$basearch will be expanded correctly and used to build the kickstart resulting in valid repo URL during install

Additional info:
~                                                                                                                                                                                                               
~

Comment 1 Dan Callaghan 2012-10-24 22:19:17 UTC
It would be nice if Beaker could substitute $basearch and $releasever and put the right URL into the repo command for Anaconda. But there's no way we can do that correctly. Yum has a *lot* of complicated logic for figuring out $basearch [1] and $releasever comes from whatever RPM provides redhat-release or whatever. So there's no practical way for Beaker to figure this stuff out for you.

I think the best we can do here is to exclude any repos with a $ variable from Anaconda, so that it doesn't get confused and hang the installation.

I'm also not sure why you have escaped the $ in your repo URL? Is that to work around an escaping bug in Beaker? If so I would like to fix that.

[1] http://yum.baseurl.org/gitweb?p=yum.git;a=blob;f=rpmUtils/arch.py;hb=HEAD

Comment 2 David Sommerseth 2012-10-30 20:24:43 UTC
(In reply to comment #1)
> I'm also not sure why you have escaped the $ in your repo URL? Is that to
> work around an escaping bug in Beaker? If so I would like to fix that.

The extract you refer to is from our XSLT template.  In XSLT, you need to escape the $ character, otherwise it's considered a local XSLT variable.  Running '\$basearch' through an XSLT processor results in '$basearch' in the XML output.

Comment 4 Dan Callaghan 2012-11-26 04:52:45 UTC
(In reply to comment #3)

Right, Beaker uses a bash heredoc like <<EOF to write out the repo configurations to /etc/yum.repos.d/ so $basearch is interpreted as a shell variable. We should be using <<"EOF" instead. I will clone a new bug for that.

Comment 5 Dan Callaghan 2012-11-26 04:58:40 UTC
(In reply to comment #4)
> I will clone a new bug for that.

Bug 880039.

Comment 6 Dan Callaghan 2012-11-27 04:06:23 UTC
On Gerrit: http://gerrit.beaker-project.org/1514

Comment 10 Dan Callaghan 2013-01-17 04:35:00 UTC
Beaker 0.11.0 has been released.