Bug 1016183

Summary: Yum metadata files are automatically called XML files during publish
Product: [Retired] Pulp Reporter: Jay Dobies <jason.dobies>
Component: rpm-supportAssignee: Mike McCune <mmccune>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 2.2CC: pthomas, skarmark
Target Milestone: ---Keywords: Triaged
Target Release: 2.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-09 06:56:49 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:

Description Jay Dobies 2013-10-07 16:46:12 UTC
I uploaded a file named "productid" as a yum metadata file. When publishing the repository, I noticed the following:

1. There is a file named "productid.xml" in the root of the published repository. This shouldn't be there.
2. There is a file named <checksum>-productid.xml in repodata. Not only was the file not uploaded with the .xml suffix, it's not an XML file at all.

This also happens in Katello use cases where a file is copied into a new repository and it is published. It is not related to the upload functionality.

The important part is that repomd.xml does refer to the product ID file correctly. "Correctly" in the sense that it points to the file with the .xml suffix. So yum continues to work; the data_type of the entry is the important part, the filename is simply a look up at that point. So nothing is broken per se, it's just very odd that .xml is automatically tacked on to the end of the file regardless.

The issue is in pulp_rpm.yum_plugin.metadata. Despite the package name, this is not only code that runs in the client-side yum plugin. The merge_custom_repodata method in there handles adding the repo metadata files to repomd.xml. Also, don't be confused by the comments in there that refer to checking the scratchpad for data. The file information is passed into the method; the conduits are not contacted at all.

In there is a line:
ftype_xml_path = os.path.join(self.repodir, "%s.xml" % ftype)

I'm not sure why the .xml suffix is hardcoded there, but the primary use case for this functionality (product ID certificates which are straight PEM format) already invalidates this as an assumption.

Comment 1 Jason Connor 2013-11-13 20:02:49 UTC
This has been fixed as part of the new yum distributor

Comment 3 Jeff Ortel 2014-04-03 13:36:15 UTC
build: 2.4.0-0.7.beta

Comment 4 Preethi Thomas 2014-06-04 19:10:35 UTC
verified
pulp-server-2.4.0-0.19.beta.fc20.noarch
Looks like this has been fixed. No productid.xml files created

Comment 5 Randy Barlow 2014-08-09 06:56:49 UTC
This has been fixed in Pulp 2.4.0-1.