Bug 1281593
| Summary: | [BACKPORT] read yum-fs vars | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Pat Riehecky <riehecky> | ||||
| Component: | yum | Assignee: | Michal Domonkos <mdomonko> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Eva Mrakova <emrakova> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 7.1 | CC: | csieh, emrakova, james.antill, mdomonko, misterbonnie, vmukhame | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | yum-3.4.3-138.el7 | Doc Type: | If docs needed, set a value | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | |||||||
| : | 1335516 (view as bug list) | Environment: | |||||
| Last Closed: | 2016-11-04 05:30:20 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: | 1327561 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
|
Description
Pat Riehecky
2015-11-12 21:27:19 UTC
Created attachment 1120191 [details]
Patch to fix
The attached patch should resolve the issue
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). 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.
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 |