Bug 768317

Summary: /usr/lib/ruby/1.8/optparse.rb:1448:in `complete': ambiguous option: -image (OptionParser::AmbiguousOption) in aeolus-cli push.
Product: [Retired] CloudForms Cloud Engine Reporter: Aziza Karol <akarol>
Component: rubygem-aeolus-cliAssignee: Martyn Taylor <mtaylor>
Status: CLOSED CURRENTRELEASE QA Contact: wes hayutin <whayutin>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.0.0CC: slinaber, ssachdev
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Aziza Karol 2011-12-16 10:47:20 UTC
Description of problem:


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


How reproducible:
I get this when i execute aeolus-cli push with  -image instead of --image.

[root@dell-pe1950-01 ~]# aeolus-cli push --account  aziza_east -image 
/usr/lib/ruby/1.8/optparse.rb:1448:in `complete': ambiguous option: -image (OptionParser::AmbiguousOption)
	from /usr/lib/ruby/1.8/optparse.rb:1287: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/gems/1.8/gems/aeolus-cli-0.2.0/lib/aeolus_cli/command/config_parser.rb:221:in `parse'
	from /usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.2.0/lib/aeolus_cli/command/config_parser.rb:37:in `process'
	from /usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.2.0/bin/aeolus-cli:20
	from /usr/bin/aeolus-cli:19:in `load'
	from /usr/bin/aeolus-cli:19



Expected results:
validation required.


Additional info:
[root@dell-pe1950-01 ~]# rpm -qa | grep aeolus
aeolus-conductor-daemons-0.7.0-4.el6.noarch
rubygem-aeolus-image-0.2.0-1.el6.noarch
aeolus-conductor-0.7.0-4.el6.noarch
rubygem-aeolus-cli-0.2.0-3.el6.noarch
aeolus-conductor-doc-0.7.0-4.el6.noarch
aeolus-all-0.7.0-4.el6.noarch
aeolus-configure-2.4.0-3.el6.noarch

Comment 2 Martyn Taylor 2012-01-17 16:32:43 UTC
commit 6fddd65af99e8b7871275e768527368a99442c7a
Author: Martyn Taylor <mtaylor>
Date:   Wed Jan 11 10:14:54 2012 +0000

    BZ#768317 Handle Ambiguous Option Exception

Comment 3 Steve Linabery 2012-01-18 21:08:52 UTC
rubygem-aeolus-cli-0.3.0-4.el6.src.rpm
72f368bd1d71eed1fef3bfa3c4878d463d154800

Comment 4 Shveta 2012-01-19 05:35:04 UTC
 aeolus-image push --account mock -image 25ca70ce-ae30-47c7-ab0f-15aaf3dd34ab

ERROR:  ImageNotFound => Could not find Image mage
[root@qe-blade-01 ~]# aeolus-image push --account mock -image

ERROR:  ImageNotFound => Could not find Image mage


===================================

Gives a better message but "Could not find Image mage" 

mage ??

rpm -qa|grep aeolus
aeolus-conductor-0.8.0-8.el6.noarch
aeolus-all-0.8.0-8.el6.noarch
aeolus-conductor-daemons-0.8.0-8.el6.noarch
rubygem-aeolus-image-0.3.0-3.el6.noarch
aeolus-configure-2.5.0-5.el6.noarch
rubygem-aeolus-cli-0.3.0-4.el6.noarch
aeolus-conductor-doc-0.8.0-8.el6.noarch

Comment 5 Martyn Taylor 2012-01-20 11:35:56 UTC
This is expected behaviour.  

It is not compulsory to have a space between the option and its value.  By specifying -image you are doing the equivalent of -i mage.  In this case the tool looks for an Image with ID "mage" which obviously does not exist and throws that error.

Cheers

Comment 6 Shveta 2012-01-20 12:34:11 UTC
oh ok .. got it .. 

Moving the bug to Verified