Bug 1144503
| Summary: | yum-plugin-downloadonly exists with error code 1 on success | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Felix Dewaleyne <fdewaley> |
| Component: | yum | Assignee: | Valentina Mukhamedzhanova <vmukhame> |
| Status: | CLOSED ERRATA | QA Contact: | Marek Marusic <mmarusic> |
| Severity: | low | Docs Contact: | |
| Priority: | medium | ||
| Version: | 6.6 | CC: | fdewaley, james.antill, ksrot, mmarusic, salmy, tdawson, vmukhame |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | yum-3.2.29-69.el6 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-07-22 07:21:26 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: | |||
| Bug Blocks: | 1075802, 1159926 | ||
|
Description
Felix Dewaleyne
2014-09-19 14:56:24 UTC
The problem is that the plugin is using PluginYumExit to exit. PluginYumExit is for exceptions, and thus will always throw a 1 or higher.
If the plugin switches to using sys.exit() it will get a proper exitcode.
Here is what I currently use as a work-around. You are free to use this if you want.
--- downloadonly.py.original 2014-09-24 09:59:50.272309627 -0500
+++ downloadonly.py 2014-09-24 10:39:36.063628706 -0500
@@ -17,6 +17,7 @@
# by Menno Smits
from yum.plugins import PluginYumExit, TYPE_INTERACTIVE
+import sys
requires_api_version = '2.1'
plugin_type = (TYPE_INTERACTIVE,)
@@ -45,4 +46,6 @@
opts, commands = conduit.getCmdLine()
# Don't die on errors, or we'll never see them.
if not conduit.getErrors() and opts.dlonly:
- raise PluginYumExit('exiting because --downloadonly specified ')
+ # We have no errors, so exitcode should be 0
+ conduit.info(2, 'exiting because --downloadonly specified')
+ sys.exit(0)
Sorry for the tab/spaces error there ... this works better.
--- downloadonly.py.original 2014-09-24 09:59:50.272309627 -0500
+++ downloadonly.py 2014-09-24 10:56:40.915588257 -0500
@@ -17,6 +17,7 @@
# by Menno Smits
from yum.plugins import PluginYumExit, TYPE_INTERACTIVE
+import sys
requires_api_version = '2.1'
plugin_type = (TYPE_INTERACTIVE,)
@@ -45,4 +46,6 @@
opts, commands = conduit.getCmdLine()
# Don't die on errors, or we'll never see them.
if not conduit.getErrors() and opts.dlonly:
- raise PluginYumExit('exiting because --downloadonly specified ')
+ # We have no errors, so exitcode should be 0
+ conduit.info(2, 'exiting because --downloadonly specified')
+ sys.exit(0)
So I guess this is a yum-utils bug then. well I don't know, that looks like the updates from Troy fix something in dowloadonly.py to me. Yep, that would be /usr/lib/yum-plugins/downloadonly.py from yum-plugin-downloadonly which is a yum-utils package. 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-2015-1384.html |