Bug 614138
Summary: | yum-rhn-plugin breaks 'yum --help' output | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | BJ Dierkes <derks> |
Component: | yum-rhn-plugin | Assignee: | Miroslav Suchý <msuchy> |
Status: | CLOSED ERRATA | QA Contact: | Martin Minar <mminar> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 5.5 | CC: | cperry, eslobodo, james.antill, jhutar, mkoci, mminar, slukasik, unixadmin |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | yum-rhn-plugin-0.5.4-19.el5 | Doc Type: | Bug Fix |
Doc Text: |
When running the "yum --help" command with rhnplugin installed, command line options for other plug-ins were not listed in the output, although the plug-in options were still working. This error has been corrected: plug-in options are now listed.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2011-07-21 07:10:48 UTC | Type: | --- |
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: | 729584 |
Description
BJ Dierkes
2010-07-13 18:15:30 UTC
We have in rhnplugin.py following lines in init_hook: opt_parser = conduit.getOptParser() if opt_parser: (opts, commands) = opt_parser.parse_args() This will effectively clear self.yum_cli_commands in /usr/share/yum-cli/cli.py (happend in getOptionsConfig when calling self.conf around line 188). I have no idea how it could break yum or why yum do not like it. James do you have idea? Seth is the one who had looked at this, IIRC the problem is that when you call opt_parser.parse_args() not all the commands are registered and parse_args() creates and caches the --help text, so when we later re-call parse_args() the new commands (from plugins) don't show up. I'll add Seth to the CC, but it'll probably be Tue-Wed next week before he can reply. in the init_hook of the rhnplugin the parse_args() gets called. This notices the --help on the argument and outputs usage() and finishes. all the rest of the plugins register their arguments in config_hook which has not yet been called at this time so they never get outputted. if you just run yum and don't add the --help it will output all the command's options properly. rhn_plugin later in init_hook call up2dateAuth.getLoginInfo which will log in to RHN/Satellite over XMLRPC. We do not want to do this call if: len(commands) == 0 command is clean --version has been passed Is there some way to retrieve commands and options without usage of that parse_args(), which will halt on that --help option? I did not find any useful method in documentation. For the two commands you're looking for and HOW you're looking for them you can just look at sys.argv and see if they exist there. Fixed in upstream. See https://bugzilla.redhat.com/show_bug.cgi?id=627525#c3 Backported as rev. 201751. I also backported https://bugzilla.redhat.com/show_bug.cgi?id=672471#c6 (which is direct cause of bug 627525) as rev. 201753 Verified in yum-rhn-plugin-0.5.4-19.el5 Reproducer: On old (not updated) machine run: 1. yum --help 2. yum --help --disableplugin=rhnplugin On updated machine run: 3. yum --help Help pages from 1. and 2. differs. Help page in 3. is same as 2. Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: When running the "yum --help" command with rhnplugin installed, command line options for other plug-ins were not listed in the output, although the plug-in options were still working. This error has been corrected: plug-in options are now listed. An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-0998.html Regression, see bug 729584 . Reopen please. |