Bug 604973 - repo file saving error when in repo id is $basearch
Summary: repo file saving error when in repo id is $basearch
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: yum (Show other bugs)
(Show other bugs)
Version: 6.1
Hardware: All Linux
medium
medium
Target Milestone: rc
: ---
Assignee: James Antill
QA Contact: Karel Srot
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: 582655
TreeView+ depends on / blocked
 
Reported: 2010-06-17 07:39 UTC by Jiri Kastner
Modified: 2014-01-21 06:18 UTC (History)
3 users (show)

Fixed In Version: yum-3.2.29-1.el6
Doc Type: Bug Fix
Doc Text:
Cause: yum would interpret repoids and then just use the interpreted value (Eg. foo$arch => fooi686) Consequence: yum would lose the original, uninterpreted, data Fix: use the original data, when saving Result: will now save as foo$arch
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-19 13:33:25 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0602 normal SHIPPED_LIVE yum bug fix and enhancement update 2011-05-19 09:37:29 UTC

Description Jiri Kastner 2010-06-17 07:39:16 UTC
Description of problem:
i'm not able using 'Add/Remove Software': 'System'->'Software sources' disable or enable repositories, having in id $basearch

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


How reproducible:
always

Steps to Reproduce:
1. define/change some repo to have $basearch instead of x86_64|i386 in id
2. try e.g. yum repolist --disablerepo=latest-x86_64-ws-6
3. passed
4. run gnome 'Add/Remove Software'
5. try disable/enable same repo as above using 'System'->'Sotfware sources'
  
Actual results:
Traceback (most recent call last):
  File "/usr/share/PackageKit/helpers/yum/yumBackend.py", line 2502, in repo_enable
    repo.disablePersistent()
  File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 411, in disablePersistent
    config.writeRawRepoFile(self,only=['enabled'])
  File "/usr/lib/python2.6/site-packages/yum/config.py", line 1008, in writeRawRepoFile
    ini[repo.id][name] = option.tostring(value)
  File "/usr/lib/python2.6/site-packages/iniparse/ini.py", line 468, in __getitem__
    return self._sections[key]
KeyError: 'latest-x86_64-ws-6-opt'

Expected results:
repo is disabled

Additional info:
[latest-$basearch-ws-6]
name=latest-$basearch-ws-6
baseurl=http://download.englab.brq.redhat.com/nightly/latest-RHEL6.0/6/Workstation/$basearch/os/
gpgcheck=0
enabled=1
metadata_expire=1h
[latest-$basearch-ws-6-opt]
name=latest-$basearch-ws-6-opt
baseurl=http://download.englab.brq.redhat.com/nightly/latest-RHEL6.0/6/Workstation/optional/$basearch/os/
gpgcheck=0
enabled=1
metadata_expire=1h

Comment 1 Richard Hughes 2010-06-17 08:54:41 UTC
PK is just doing repo.disablePersistent() -- I think this must be a yum bug.

Comment 2 seth vidal 2010-06-17 13:56:33 UTC
The problem here is the $basearch value in the [repoid]

We're not converting back to it so it can't find it in the list of repos it knows.

I'm looking for a nice fix now.

Comment 3 James Antill 2010-06-17 14:47:48 UTC
I would have beta  lot that this didn't work (becase $ is not allowed in a repoid) ... but it turns out that ConfigPreProcessor() is doing the substitution before we even see it.
Ie. what we get from parser.sections() has already had the replacements done.

Comment 6 seth vidal 2010-06-17 15:30:16 UTC
patch that fixes this problem sent upstream.

Comment 11 Karel Srot 2011-02-21 15:28:34 UTC
I have filed a new bug 679098 regarding yum-config-manager since the GUI variant seems to be fixed with yum-3.2.29-5.el6.noarch but yum-config-manager tracebacks in a similar way.

Comment 13 James Antill 2011-05-12 19:05:35 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: yum would interpret repoids and then just use the interpreted value (Eg. foo$arch => fooi686)
Consequence: yum would lose the original, uninterpreted, data
Fix: use the original data, when saving
Result: will now save as foo$arch

Comment 14 errata-xmlrpc 2011-05-19 13:33:25 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0602.html


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