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 1281593 - [BACKPORT] read yum-fs vars
Summary: [BACKPORT] read yum-fs vars
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum
Version: 7.1
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Michal Domonkos
QA Contact: Eva Mrakova
URL:
Whiteboard:
Depends On: 1327561
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-12 21:27 UTC by Pat Riehecky
Modified: 2016-11-04 05:30 UTC (History)
6 users (show)

Fixed In Version: yum-3.4.3-138.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1335516 (view as bug list)
Environment:
Last Closed: 2016-11-04 05:30:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch to fix (2.66 KB, patch)
2016-02-01 16:45 UTC, Pat Riehecky
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2397 0 normal SHIPPED_LIVE yum bug fix and enhancement update 2016-11-03 13:55:12 UTC

Description Pat Riehecky 2015-11-12 21:27:19 UTC
Description of problem:
Can upstream commit, 22271bf34e71bbfc75d0a59354fc0108e004f36c, which re-reads yum-fs vars be backported to yum

Version-Release number of selected component (if applicable):yum-3.4.3-125.el7


How reproducible:100%


Steps to Reproduce:
1.
2.
3.

Actual results:
yum fs vars are not read as expected

Expected results:
yum fs vars are read as expected

Additional info:
http://yum.baseurl.org/gitweb?p=yum.git;a=commit;h=22271bf34e71bbfc75d0a59354fc0108e004f36c

Comment 2 Pat Riehecky 2016-02-01 16:45:52 UTC
Created attachment 1120191 [details]
Patch to fix

The attached patch should resolve the issue

Comment 4 Michal Domonkos 2016-04-15 09:35:20 UTC
Hi Karel,

Previously, yum wouldn't expand fsvars used in include= lines in /etc/yum.conf or repo files.  That's what this commit is fixing.  Here's a reproducer:

# echo debuglevel=10 > /root/foo.conf
# echo foo > /etc/yum/vars/myvar
# echo 'include=/root/$myvar.conf' >> /etc/yum.conf
# yum repolist  # or whichever yum subcommand

Before the patch, yum would terminate with this error message:

CRITICAL:yum.cli:Config error: Error accessing file for config file:///root/$myvar.conf

After the patch, the command (yum repolist in this case) should succeed and the configuration from /root/foo.conf should be applied (being more verbose in this case).

Comment 5 Michal Domonkos 2016-04-15 09:51:27 UTC
Actually, there was a small typo in the original commit that got fixed subsequently in upstream:

diff --git a/yum/config.py b/yum/config.py
index 1b5a11d..8eab5bc 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -1061,7 +1061,7 @@ def readStartupConfig(configfile, root, releasever=None):
     confpp_obj = ConfigPreProcessor(configfile)

     yumvars = _getEnvVar()
-    _read_yumvars(yumvars, yumconf.installroot)
+    _read_yumvars(yumvars, startupconf.installroot)
     confpp_obj._vars = yumvars
     startupconf.yumvars = yumvars

So we should backport both commits, that is:

22271bf34e71bbfc75d0a59354fc0108e004f36c
1ccd91f4b195737d6bb1bdfabcbf3714de1d9b85

Apparently, Pat noticed the issue too and fixed that in a different way in the attached patch (thanks!):

@@ -1044,6 +1061,8 @@ def readStartupConfig(configfile, root, releasever=None):
     confpp_obj = ConfigPreProcessor(configfile)
 
     yumvars = _getEnvVar()
+    _read_yumvars(yumvars, '/')
+    _read_yumvars(yumvars, startupconf.installroot)
     confpp_obj._vars = yumvars
     startupconf.yumvars = yumvars

However, we should prefer the upstream fixup anyway, since reading yumvars from '/' is not desirable if the installroot is non-default.

Comment 11 errata-xmlrpc 2016-11-04 05:30:20 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.

https://rhn.redhat.com/errata/RHBA-2016-2397.html


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