Bug 852591 - yum does not verify options before taking actions [NEEDINFO]
yum does not verify options before taking actions
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: yum (Show other bugs)
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: James Antill
Patrik Kis
Depends On:
  Show dependency treegraph
Reported: 2012-08-28 22:51 EDT by Subhendu Ghosh
Modified: 2016-10-04 00:31 EDT (History)
5 users (show)

See Also:
Fixed In Version: yum-3.2.29-31.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-12-15 09:06:39 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
james.antill: needinfo?

Attachments (Terms of Use)

  None (edit)
Description Subhendu Ghosh 2012-08-28 22:51:32 EDT
Description of problem:
Invoking yum with an incorrect option does not cause yum to error out immediately. 

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

How reproducible:

Steps to Reproduce:
1. yum --disaberepo=* --enablerepo=rhel list available
Actual results:
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.

Please use yum-config-manager to configure which software
repositories are used with Red Hat Subscription Management.

Command line error: no such option: --disaberepo

real	0m6.016s
user	0m5.156s
sys	0m0.044s

Expected results:
Immediate error condition for unrecognized options or commands - before the repos are parsed.

Additional info:
Comment 2 James Antill 2012-08-29 12:07:25 EDT
 Assuming this is: 2853dc82e1c14ce15451a3f184507483fe29e85a aka. BZ 773512.
Comment 5 Patrik Kis 2012-11-14 08:07:03 EST
Hi James,

I tried to reproduce this issue but I cannot.
When I try to run yum with an incorrect option it quits quite fast no matter if it is the new or old one. There is also no difference in output log.

The problem is that when yum is started with invalid option (like --disaberepo) it exits before the code that was patched starts to be executed. It exists in the beginning of function setupYumConfig with self.parse_args.

I'm confused; am I missing something?
Comment 7 James Antill 2012-11-19 14:34:31 EST
 Yeh, I assumed that the bug was actually the same as BZ 773512 ... which is that:

yum upodate kernel --enablerepo=updates-testing

...will load the repos. and then tell you there is a failure. AFAIK we have always parsed command line options before repos.
Comment 8 Patrik Kis 2012-11-19 16:15:15 EST
Unfortunately I'm not able to reproduce the issue reported in this bug.
In my case yum quits instantly, print out the available commands and drops error. So I'm not sure what it was doing so long in your case.
Could you pleas provide the full yum output and also the output of yum-config-manager? Thanks.
Comment 9 Patrik Kis 2012-11-19 16:19:04 EST
Here is what I get on my system:

# rpm -q yum
# time yum --disaberepo=* --enablerepo=rhel6 list available
Loaded plugins: auto-update-debuginfo, refresh-packagekit, security
Usage: yum [options] COMMAND

List of Commands:

check          Check for problems in the rpmdb
check-update   Check for available package updates
clean          Remove cached data
deplist        List a package's dependencies
distribution-synchronization Synchronize installed packages to the latest available versions
downgrade      downgrade a package
erase          Remove a package or packages from your system
groupinfo      Display details about a package group
groupinstall   Install the packages in a group on your system
grouplist      List available package groups
groupremove    Remove the packages in a group from your system
help           Display a helpful usage message
history        Display, or use, the transaction history
info           Display details about a package or group of packages
install        Install a package or packages on your system
list           List a package or groups of packages
load-transaction load a saved transaction from filename
makecache      Generate the metadata cache
provides       Find what package provides the given value
reinstall      reinstall a package
repolist       Display the configured software repositories
resolvedep     Determine which package provides the given dependency
search         Search package details for the given string
shell          Run an interactive yum shell
update         Update a package or packages on your system
update-minimal Works like update, but goes to the 'newest' package match which fixes a problem that affects your system
updateinfo     Acts on repository update information
upgrade        Update packages taking obsoletes into account
version        Display a version for the machine and/or available repos.

Command line error: no such option: --disaberepo

real	0m0.100s
user	0m0.079s
sys	0m0.021s
Comment 12 James Antill 2013-04-09 17:47:35 EDT
Still need info. on the original bug, so we can reproduce it.
Comment 13 RHEL Product and Program Management 2013-10-14 00:49:16 EDT
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Comment 14 Valentina Mukhamedzhanova 2014-12-15 09:06:39 EST
As there seems to be no new information on this bug, I'm closing it.

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