Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1544506

Summary: createrepo error with space in baseurl path
Product: Red Hat Enterprise Linux 7 Reporter: Gregory Young <gregory.young>
Component: createrepoAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.4CC: emrakova, gregory.young, james.antill, mdomonko
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-26 07:46:01 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 Gregory Young 2018-02-12 17:06:06 UTC
Description of problem:

Running createrepo in a folder tree that has a space in it causes a failure and stack trace.

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

createrepo 0.9.9

on Downstream CentOS 7.4

[root@localhost system]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

How reproducible:

every time.

Steps to Reproduce:

1. Run createrepo from withing, or specifying a path with a space in it. For example:

createrepo -g '/tmp/a dir with spaces/system/isodir/comps.xml' -dp --workers=4 --update '/tmp/a dir with spaces/system/isodir'/

Actual results:

[root@localhost system]# createrepo -g '/tmp/a dir with spaces/system/isodir/comps.xml' -dp --workers=4 --update '/tmp/a dir with spaces/system/isodir'/
Traceback (most recent call last):
  File "/usr/share/createrepo/genpkgmetadata.py", line 309, in <module>
    main(sys.argv[1:])
  File "/usr/share/createrepo/genpkgmetadata.py", line 270, in main
    mdgen.doPkgMetadata()
  File "/usr/lib/python2.7/site-packages/createrepo/__init__.py", line 400, in doPkgMetadata
    self._setup_old_metadata_lookup()
  File "/usr/lib/python2.7/site-packages/createrepo/__init__.py", line 386, in _setup_old_metadata_lookup
    self.oldData = readMetadata.MetadataIndex(old_repo_path, opts)
  File "/usr/lib/python2.7/site-packages/createrepo/readMetadata.py", line 51, in __init__
    self._repo.baseurl = 'file://' + realpath
  File "/usr/lib/python2.7/site-packages/yum/config.py", line 104, in __set__
    value, str(e)))
ValueError: Error parsing "baseurl = 'file:///tmp/a dir with spaces/system/isodir'": URL must be http, ftp, file or https not ""


Expected results:

Complete without error.

Additional info:

Simple fix, a single variable was not quoted to prevent globing.

The key is this line:

File "/usr/lib/python2.7/site-packages/createrepo/readMetadata.py", line 51, in __init__


Change:

self._repo.baseurl = 'file://' + realpath


To:

self._repo.baseurl = 'file://' + 'realpath'

Comment 3 Daniel Mach 2019-07-26 07:46:01 UTC
There is no plan to fix this bug during RHEL 7 life cycle.
If you still consider the issue important, please contact your support representative.