Bug 1005282

Summary: yum.update_md.UpdateNotice.xml() omits the RPM epochs
Product: Red Hat Enterprise Linux 6 Reporter: Randy Barlow <rbarlow>
Component: yumAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: Karel Srot <ksrot>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.4CC: james.antill, ksrot, mhrivnak, vmukhame
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: yum-3.2.29-50.el6 Doc Type: Bug Fix
Doc Text:
NO DOCS NEEDED
Story Points: ---
Clone Of:
: 1005288 (view as bug list) Environment:
Last Closed: 2014-10-14 04:36:38 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:
Bug Depends On: 1020540    
Bug Blocks: 980611, 1005288    

Description Randy Barlow 2013-09-06 15:12:12 UTC
In yum.update_md, there is a class called UpdateNotice. This class seems to be used to represent an Errata, and the Pulp project uses the xml() method in this class to generate the updateinfo.xml files when we publish Yum repositories.

We are experiencing a problem in #980611 where the generated XML does not include epochs in the RPMs that are referenced by the errata. I believe it is due to a simple omission of the epoch in lines 365-372 in update_md.py.

I think something like this would probably resolve our issue:

msg += """      <package arch="%s" name="%s" epoch="%s" release="%s" src="%s" version="%s">
        <filename>%s</filename>
      </package>\n""" % (to_xml(pkg['arch'], attrib=True),
                                to_xml(pkg['name'], attrib=True),
                                to_xml(pkg['epoch'], attrib=True),
                                to_xml(pkg['release'], attrib=True),
                                to_xml(pkg['src'], attrib=True),
                                to_xml(pkg['version'], attrib=True),
                                to_xml(pkg['filename']))

It may be worthwhile to consider something like ElementTree for generating this XML, though for the sake of consistency and ease, simply adding epoch to the existing code would probably be the desireable solution.

Thanks, and let me know if you have any questions.

Comment 1 Randy Barlow 2013-09-06 15:13:37 UTC
I forgot to mention the version of Yum that I am using (which would probably help identify the line numbers I referenced better…)

$ rpm -q yum
yum-3.2.29-40.el6.noarch

Comment 3 James Antill 2013-10-15 18:02:14 UTC
 This was fixed upstream, adding ACKs for el6:

commit bd351efeac0e5d81af900150defcb8e2a9e0497c
Author: James Antill <james>
Date:   Fri Sep 6 09:34:05 2013 -0400

    Add epoch to updateinfo xml output.

Comment 4 Randy Barlow 2013-10-17 21:41:14 UTC
There seems to be an encoding bug in the fix for this issue that I've filed a Fedora 19 report about. We might want to hold off on backporting this fix to RHEL6 until #1020540 is also fixed, if you don't mind.

https://bugzilla.redhat.com/show_bug.cgi?id=1020540

I'll mark this bug as depending on that one.

Thanks so much for your help!

Comment 9 errata-xmlrpc 2014-10-14 04:36:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1410.html