Bug 869758 - custom repos available at install time containing var (ie $basearch)
custom repos available at install time containing var (ie $basearch)
Status: CLOSED CURRENTRELEASE
Product: Beaker
Classification: Community
Component: scheduler (Show other bugs)
0.9
Unspecified Linux
unspecified Severity unspecified (vote)
: 0.11
: ---
Assigned To: Dan Callaghan
Qixiang Wan
Kickstart
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-24 14:26 EDT by MikeBoswell
Modified: 2013-01-16 23:35 EST (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 880039 (view as bug list)
Environment:
Last Closed: 2013-01-16 23:35:00 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
access_log (3.65 KB, application/octet-stream)
2012-10-24 14:26 EDT, MikeBoswell
no flags Details

  None (edit)
Description MikeBoswell 2012-10-24 14:26:46 EDT
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 18:19:17 EDT
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 16:24:43 EDT
(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-25 23:52:45 EST
(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-25 23:58:40 EST
(In reply to comment #4)
> I will clone a new bug for that.

Bug 880039.
Comment 6 Dan Callaghan 2012-11-26 23:06:23 EST
On Gerrit: http://gerrit.beaker-project.org/1514
Comment 10 Dan Callaghan 2013-01-16 23:35:00 EST
Beaker 0.11.0 has been released.

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