[Yum-devel] [PATCH] Catch error opening repo files

Jeremy Katz katzj at redhat.com
Wed May 13 19:56:16 UTC 2009


On Wednesday, May 13 2009, Seth Vidal said:
> On Wed, 13 May 2009, James Antill wrote:
>> On Wed, 2009-05-13 at 14:16 -0400, Jeremy Katz wrote:
>>> Rather than requiring higher level callers to catch the error,
>>> we should catch the error at the low-level when opening the
>>> repo file and turn it into a RepoMDError.  Related to
>>> rh bz#500526
>>
>> Not that I think this change is bad, but I don't see how the it fails
>> atm. bz#500526 has:
>>
>> Traceback (most recent call first):
>>  File "/usr/lib/python2.6/site-packages/yum/repoMDObject.py", line 84, in __init__
>>    infile = open(srcfile, 'rt')
>>  File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 958, in _parseRepoXML
>>    return repoMDObject.RepoMD(self.id, local)
>>  File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 1158, in _commonLoadRepoXML
>>    self._repoXML = self._parseRepoXML(result)
>>
>> ...but it should only get to that _parseRepoXML() line if
>> _cachingRepoXML() returns true (repomd.xml is on the FS and within the
>> cache timeout) or _getFileRepoXML() returns with data (file
>> "downloaded", and thus. is on the FS).
>
> in anaconda some of the pre stuff is pre-empted, I think.

Yeah, we do some odd stuff.  You could generally get an IO error even if
the file exists, though in some (admittedly odd) cases

Jeremy


More information about the Yum-devel mailing list