Bug 860954 - [US2597][fork] Can not create app with option "-a $appname -t $type" or " $appname -t $type" successfully
Summary: [US2597][fork] Can not create app with option "-a $appname -t $type" or " $ap...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: John (J5) Palmieri
QA Contact: libra bugs
URL:
Whiteboard:
: 860931 860979 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-27 07:54 UTC by Rony Gong 🔥
Modified: 2015-05-15 02:05 UTC (History)
4 users (show)

Fixed In Version: fork_ami_US2597_US2599_US2813_US2817_US2872_186
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-06 18:48:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Rony Gong 🔥 2012-09-27 07:54:26 UTC
Description of problem:
since we could get -a option in rhc app create -h
we could use -a option to create app

for this ami, we can create app only by
rhc app create <appname> -t php-5.3

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

How reproducible:
always


Steps to Reproduce:
1. rhc app create -a q3ruby19  -t ruby-1.9 
2.
3.
  
Actual results:
[root@F17x64-openshift rhc]# rhc app create -a q3ruby19  -t ruby-1.9 
Password: 

/usr/local/share/gems/gems/rhc-0.99.3/lib/rhc/commands/base.rb:60:in `block in validate_args_and_options': Missing required argument 'cartridge'. (ArgumentError)
	from /usr/local/share/gems/gems/rhc-0.99.3/lib/rhc/commands/base.rb:51:in `each'
	from /usr/local/share/gems/gems/rhc-0.99.3/lib/rhc/commands/base.rb:51:in `each_with_index'
	from /usr/local/share/gems/gems/rhc-0.99.3/lib/rhc/commands/base.rb:51:in `validate_args_and_options'
	from /usr/local/share/gems/gems/rhc-0.99.3/lib/rhc/commands.rb:100:in `block (3 levels) in to_commander'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:155:in `run'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/runner.rb:402:in `run_active_command'
	from /usr/local/share/gems/gems/rhc-0.99.3/lib/rhc/command_runner.rb:55:in `run!'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/delegates.rb:11:in `run!'
	from /usr/local/share/gems/gems/rhc-0.99.3/lib/rhc/cli.rb:40:in `start'
	from /usr/local/share/gems/gems/rhc-0.99.3/bin/rhc:57:in `<top (required)>'
	from /usr/local/bin/rhc:23:in `load'
	from /usr/local/bin/rhc:23:in `<main>'



Expected results:
could create app success, maybe both support add -a and don't add -a option.


Additional info:

Comment 1 John (J5) Palmieri 2012-09-27 23:14:32 UTC
removed a global option which used -t

Comment 2 Rony Gong 🔥 2012-09-28 02:43:53 UTC
restest it on my ruby-1.8 env, in fork_ami_US2597_US2599_US2813_US2817_US2872_173

[qgong@localhost rhc]$ rhc app create -a q3ruby19  -t ruby-1.9
/usr/lib/ruby/1.8/optparse.rb:1448:in `complete': ambiguous option: -t (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/commander-4.1.2/lib/commander/runner.rb:337:in `parse_global_options'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.99.3/lib/rhc/command_runner.rb:29:in `run!'
	from /usr/lib/ruby/gems/1.8/gems/commander-4.1.2/lib/commander/delegates.rb:7:in `run!'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.99.3/lib/rhc/cli.rb:40:in `start'
	from /usr/lib/ruby/gems/1.8/gems/rhc-0.99.3/bin/rhc:21
	from /usr/bin/rhc:19:in `load'
	from /usr/bin/rhc:19

Comment 3 Xiaoli Tian 2012-09-28 05:36:40 UTC
Tested on the version on fork_ami_US2597_US2599_US2813_US2817_US2872_173

1) rhc app create $appname -t $type does not work
[root@F17x64-openshift ~]# rhc app create app1 -t python-2.6 -l xtian+t5
/usr/local/share/gems/gems/commander-4.1.2/lib/commander/runner.rb:337:in `parse_global_options': ambiguous option: -t (OptionParser::AmbiguousOption)
	from /usr/local/share/gems/gems/rhc-0.99.3/lib/rhc/command_runner.rb:29:in `run!'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/delegates.rb:11:in `run!'
	from /usr/local/share/gems/gems/rhc-0.99.3/lib/rhc/cli.rb:40:in `start'
	from /usr/local/share/gems/gems/rhc-0.99.3/bin/rhc:21:in `<top (required)>'
	from /usr/local/bin/rhc:23:in `load'
	from /usr/local/bin/rhc:23:in `<main>'

2) rhc app create -a $appname -t $type does not work 
[root@F17x64-openshift ~]# rhc app create -a app1 -t python-2.6 -l xtian+t5
/usr/local/share/gems/gems/commander-4.1.2/lib/commander/runner.rb:337:in `parse_global_options': ambiguous option: -t (OptionParser::AmbiguousOption)
	from /usr/local/share/gems/gems/rhc-0.99.3/lib/rhc/command_runner.rb:29:in `run!'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/delegates.rb:11:in `run!'
	from /usr/local/share/gems/gems/rhc-0.99.3/lib/rhc/cli.rb:40:in `start'
	from /usr/local/share/gems/gems/rhc-0.99.3/bin/rhc:21:in `<top (required)>'
	from /usr/local/bin/rhc:23:in `load'
	from /usr/local/bin/rhc:23:in `<main>'

3) Only rhc app create $appname $apptype works now
[root@F17x64-openshift ~]# rhc app create app1  python-2.6 -l xtian+t5
Password: *

Comment 4 John (J5) Palmieri 2012-09-28 16:37:34 UTC
*** Bug 860979 has been marked as a duplicate of this bug. ***

Comment 5 John (J5) Palmieri 2012-09-28 16:38:36 UTC
*** Bug 860931 has been marked as a duplicate of this bug. ***

Comment 6 John (J5) Palmieri 2012-09-28 22:28:46 UTC
Fixed lash with --timeout and --trace as well as allow options to map to arguments of different names.  In this case --type maps to the cartridge arg.

Comment 7 Rony Gong 🔥 2012-09-29 02:45:07 UTC
Verified on fork_ami_US2597_US259...US2817_US2872_186
[qgong@localhost dev]$ rhc app create -a qphp -t php-5.3
Password: 

Creating application 'qphp'
===========================

  Cartridge: php-5.3
  Scaling:   no
  Gear Size: default
  Namespace: qgong10

Your application's domain name is being propagated worldwide (this might take a minute)...
Initialized empty Git repository in /home/qgong/mytest/dev/qphp/.git/
done

RESULT:
Application qphp was created.

[qgong@localhost dev]$ rhc app create  q2php -t php-5.3
Password: 

Creating application 'q2php'
============================

  Cartridge: php-5.3
  Scaling:   no
  Namespace: qgong10
  Gear Size: default

Your application's domain name is being propagated worldwide (this might take a minute)...
Initialized empty Git repository in /home/qgong/mytest/dev/q2php/.git/
done

RESULT:
Application q2php was created.

[qgong@localhost dev]$ rhc app create  -a q4php php-5.3
Password: 

Creating application 'q4php'
============================

  Namespace: qgong10
  Scaling:   no
  Cartridge: php-5.3
  Gear Size: default

Your application's domain name is being propagated worldwide (this might take a minute)...
Initialized empty Git repository in /home/qgong/mytest/dev/q4php/.git/
done

RESULT:
Application q4php was created.

[qgong@localhost dev]$ rhc app create q5php php-5.3
Password: 

Creating application 'q5php'
============================

  Scaling:   no
  Cartridge: php-5.3
  Gear Size: default
  Namespace: qgong10

Your application's domain name is being propagated worldwide (this might take a minute)...
Initialized empty Git repository in /home/qgong/mytest/dev/q5php/.git/
done

RESULT:
Application q5php was created.


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