Bug 850205 - traceback when bad option is provided to wallaby
Summary: traceback when bad option is provided to wallaby
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: wallaby
Version: 2.2
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: 2.3
: ---
Assignee: Will Benton
QA Contact: Lubos Trilety
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-21 13:49 UTC by Lubos Trilety
Modified: 2013-03-06 18:45 UTC (History)
4 users (show)

Fixed In Version: wallaby-0.16.2-1
Doc Type: Bug Fix
Doc Text:
Cause: Previous versions of the wallaby shell failed to trap certain errors from the parameter handling library. Consequence: Previous versions of the wallaby shell displayed unfriendly error messages to users if they were invoked with incorrect command-line arguments. Fix: The wallaby shell now traps these errors. Result: The error message displayed when wallaby is invoked with incorrect command-line arguments is now user-friendly.
Clone Of:
Environment:
Last Closed: 2013-03-06 18:45:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0564 0 normal SHIPPED_LIVE Low: Red Hat Enterprise MRG Grid 2.3 security update 2013-03-06 23:37:09 UTC

Description Lubos Trilety 2012-08-21 13:49:30 UTC
Description of problem:
If the wallaby is run with --h (--a, --p, --u) it ends with traceback output similar to this one:
# wallaby --h
/usr/lib/ruby/1.8/optparse.rb:1379:in `complete': ambiguous option: --h (OptionParser::AmbiguousOption)
	from /usr/lib/ruby/1.8/optparse.rb:1212:in `order!'
	from /usr/lib/ruby/1.8/optparse.rb:1205:in `catch'
	from /usr/lib/ruby/1.8/optparse.rb:1205:in `order!'
	from /usr/lib/ruby/1.8/optparse.rb:1279:in `permute!'
	from /usr/lib/ruby/1.8/optparse.rb:1300:in `parse!'
	from /usr/lib/ruby/site_ruby/1.8/mrg/grid/config/shell.rb:144:in `main'
	from /usr/bin/wallaby:21

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

How reproducible:
100%

Steps to Reproduce:
1. run wallaby --h
2. see result
3.
  
Actual results:
ruby traceback is printed

Expected results:
The option is correctly parsed, no traceback printed

Additional info:

Comment 1 Will Benton 2012-08-21 17:51:38 UTC
There is a fix in the bz850205 branch, which will be merged into master at some point in the future.

Comment 3 Lubos Trilety 2012-12-11 11:14:33 UTC
Tested with wallaby-0.16.1-2

--h and --p works fine, but --a and --u have still similar issue.

# wallaby --u
/usr/lib/ruby/1.8/optparse.rb:451:in `parse': missing argument: --u (OptionParser::MissingArgument)
	from /usr/lib/ruby/1.8/optparse.rb:1266:in `parse_in_order'
	from /usr/lib/ruby/1.8/optparse.rb:1254:in `catch'
	from /usr/lib/ruby/1.8/optparse.rb:1254:in `parse_in_order'
	from /usr/lib/ruby/1.8/optparse.rb:1248:in `order!'
	from /usr/lib/ruby/1.8/optparse.rb:1339:in `permute!'
	from /usr/lib/ruby/1.8/optparse.rb:1360:in `parse!'
	from /usr/lib/ruby/site_ruby/1.8/mrg/grid/config/shell.rb:144:in `main'
	from /usr/bin/wallaby:21

# wallaby --a
/usr/lib/ruby/1.8/optparse.rb:451:in `parse': missing argument: --a (OptionParser::MissingArgument)
	from /usr/lib/ruby/1.8/optparse.rb:1266:in `parse_in_order'
	from /usr/lib/ruby/1.8/optparse.rb:1254:in `catch'
	from /usr/lib/ruby/1.8/optparse.rb:1254:in `parse_in_order'
	from /usr/lib/ruby/1.8/optparse.rb:1248:in `order!'
	from /usr/lib/ruby/1.8/optparse.rb:1339:in `permute!'
	from /usr/lib/ruby/1.8/optparse.rb:1360:in `parse!'
	from /usr/lib/ruby/site_ruby/1.8/mrg/grid/config/shell.rb:144:in `main'
	from /usr/bin/wallaby:21

>>> assigned

Comment 4 Will Benton 2013-01-04 21:44:17 UTC
Missing arguments are handled now as well.

Comment 5 Lubos Trilety 2013-01-18 10:58:00 UTC
Tested with:
wallaby-utils-0.16.3-1
wallaby-0.16.3-1

Tested on:
RHEL6 x86_64,i386
RHEL5 x86_64,i386

all tested options works correctly --a, --u, --h, --p

>>> verified

Comment 7 errata-xmlrpc 2013-03-06 18:45:10 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.

http://rhn.redhat.com/errata/RHSA-2013-0564.html


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