Bug 1010939

Summary: [origin_ui_88] The help info of domain configure is so confusing so that user can use --no-allowed-gear-sizes option with arguments, and actually it is not supported
Product: OpenShift Online Reporter: Wei Sun <wsun>
Component: ocAssignee: Jordan Liggitt <jliggitt>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: jliggitt, wjiang
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-24 03:23:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Wei Sun 2013-09-23 10:36:34 UTC
Description of problem:
Check rhc domain-configure -h,could get "--[no-]allowed-gear-sizes [SIZES] A comma-delimited list of the gear sizes that will be allowed in this domain."

But try to unset one gear size (such as small )when an account have two gear sizes(small and medium),will get "Too many arguments passed in: small no-allowed-gear-sizes --",and could not unset gear size successfully.Only allow to unset all gear sizes,but for website,could unset one gear size .

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

How reproducible:
Always

Steps to Reproduce:
1.Create a domain with a silver account
2.Make sure have medium and small gear size in the domain
3.Try to  unset small gear size for the domain via CLI
4.Try to unset all gear size for the domain via CLI

Actual results:
2.[wsun@dhcp-8-229 dev]$ rhc domain-configure wsunfork8441 --allowed-gear-sizes small,medium
Updating domain configuration ... done

Domain wsunfork8441 configuration
---------------------------------
  Allowed Gear Sizes: small, medium

3.[wsun@dhcp-8-229 dev]$ rhc domain-configure wsunfork8441 --no-allowed-gear-sizes small
Too many arguments passed in: small
Usage: rhc domain-configure <namespace>
Pass '--help' to see the full list of options

4.[wsun@dhcp-8-229 dev]$ rhc domain-configure wsunfork8441 --no-allowed-gear-sizes 
Updating domain configuration ... done

Domain wsunfork8441 configuration
---------------------------------
  Allowed Gear Sizes: <none>


Expected results:
Should allow to unset one gear size for the domain via CLI

Additional info:

Comment 1 Wei Sun 2013-09-23 11:44:54 UTC
rhc version is rhc 1.15.0 build from fork_ami_origin_ui_72_membership_844

Comment 2 Clayton Coleman 2013-09-23 17:48:38 UTC
This is difficult for us to fix because the upstream command library we use is what is providing this behavior to us.

The supported calls are:

--no-allowed-gear-sizes
  sets the allowed gear sizes to []
--allowed-gear-sizes=
  sets the allowed gear sizes to []
--allowed-gear-sizes=small,medium
  sets the allowed gear sizes to [small,medium]

All other options are unsupported.

Comment 3 weiwei jiang 2013-11-12 09:47:24 UTC
Tried with rhc-1.17.3, and the help info is so confusing.

According to the help info of domain configure,[SIZES] arguments of  --no-allowed-gear-sizes option is optional, means you can pass a argument to --no-allowed-gear-sizes, and actually it is not supported.

$ rhc domain configure -h
Usage: rhc domain-configure <namespace>

Change one or more configuration settings on the domain


Options
  --[no-]allowed-gear-sizes [SIZES] A comma-delimited list of the gear sizes that will be allowed in this domain.
  -n, --namespace NAME              Name of a domain

Global Options
  -l, --rhlogin LOGIN       OpenShift login
  -p, --password PASSWORD   OpenShift password
  --token TOKEN             An authorization token for accessing your account.
  --server NAME             An OpenShift server hostname (default: openshift.redhat.com)
  --timeout SECONDS         The timeout for operations

  See 'rhc help options' for a full list of global options.

And I hope the help info will be more clear, thx

Comment 4 Jordan Liggitt 2013-11-12 15:25:35 UTC
Separated --allowed-gear-sizes and --no-allowed-gear-sizes options
Will merge in https://github.com/openshift/rhc/pull/509

Comment 5 openshift-github-bot 2013-11-12 19:56:44 UTC
Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/4562271c9aa1e2e8865c97057b5d992dd40e3c5b
Bug 1010939: Improve no allowed gear sizes

Comment 6 weiwei jiang 2013-11-13 02:38:50 UTC
Tried on devenv_4027, and result as follow:

[root@ip-10-185-177-123 ~]# rhc configure-domain --help
Usage: rhc domain-configure <namespace>

Change one or more configuration settings on the domain


Options
  --no-allowed-gear-sizes      Do not allow any gear sizes in this domain.
  --allowed-gear-sizes [SIZES] A comma-delimited list of gear sizes allowed in this domain. To see available sizes, run 'rhc account'.
  -n, --namespace NAME         Name of a domain

Global Options
  -l, --rhlogin LOGIN       OpenShift login
  -p, --password PASSWORD   OpenShift password
  --token TOKEN             An authorization token for accessing your account.
  --server NAME             An OpenShift server hostname (default: openshift.redhat.com)
  --timeout SECONDS         The timeout for operations

  See 'rhc help options' for a full list of global options.

So, verified this issue. Thx.