Bug 1140816 - oo-admin-ctl-district missing documentation for listing districts
Summary: oo-admin-ctl-district missing documentation for listing districts
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 2.2.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Vu Dinh
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-11 18:32 UTC by Erik M Jacobs
Modified: 2016-03-22 16:50 UTC (History)
9 users (show)

Fixed In Version: openshift-origin-broker-util-1.37.5.2-1.el6op
Doc Type: Bug Fix
Doc Text:
Cause: The 'oo-admin-ctl-district' doesn't have option to list all districts and the only way to display those information to execute a command without any arguments. The option "list-available" is poorly named as it doesn't show list information. The 'oo-admin-ctl-region' experiences the same behavior with displaying a list of regions when no options are selected. Consequence: There is no visual option to display list information. Instead, "oo-admin-ctl-district/region" command is executed without any parameters in order to display a list of districts/regions. Also, the option 'list-available' is misleading as it displays a list of available nodes, not districts. Fix: Added the list option to oo-admin-ctl-district and oo-admin-ctl-region to list all available districts or regions. The "list-available" option is renamed to "nodes-available" to avoid the confusion. Also, if no arguments are given, the command will display usage message to guide user. Result: Both commands provide all necessary options to display the appropriate information instead of the ambiguous non-argument option.
Clone Of:
Environment:
Last Closed: 2016-03-22 16:50:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:0489 0 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 2.2.9 security, bug fix, and enhancement update 2016-03-22 20:49:04 UTC

Description Erik M Jacobs 2014-09-11 18:32:29 UTC
Description of problem:
oo-admin-ctl-district doesn't tell you how to list the districts, and the "list-available" help is misleading.

Version-Release number of selected component (if applicable):
openshift-origin-broker-util-1.23.8.11-1.el6op.noarch

Steps to Reproduce:
oo-admin-ctl-district -h

Actual results:
== Synopsis

oo-admin-ctl-district: Control districts

== Usage

oo-admin-ctl-district OPTIONS

Options:
-c|--command <command>
    (list-available|create|add-node|set-region|unset-region|deactivate-node|activate-node|remove-node|add-capacity|remove-capacity|destroy|publish-uids)
-u|--uuid <district uuid>
    District uuid  (alphanumeric)
-n|--name <district name>
    District name (Used on create or in place of uuid on other commands)
    Allowed chars: alphanumeric, underscore, hyphen, dot
-p|--node_profile <gear_size>
    Only required for create
-i|--server_identity
    Node server identity (required) (may be a comma-separated list)
-a|--available
    On add-node, add all available nodes with the right profile
-r|--region <region_name>
    Region name of the server identitiy.
    Only valid for add-node (optional) and set-region
-z|--zone <zone_name>
    Zone within the region. Only valid when region is specified
-s|--size
    Amount of capacity to add or remove (positive number) (required)
-o|--platform
    Specify the platform of the district, default value is Linux
-b|--bypass
    Ignore warnings
-h|--help
    Show usage info

Expected results:
1) There is no indication that running "oo-admin-ctl-district" with no options will list the districts. Either we need to:

a) add a "list" option that will list districts
b) suggest in the output that running it with no option will list.

2) "list-available" sounds misleading. It sounds like it will list the available districts. For someone who doesn't know any better, when looking at this output:

[root@broker openshift]# oo-admin-ctl-district -c list-available
Nodes in profile: small
        node1.user1.example.com

It makes me think that the nodes listed are in a district/profile... but that's just because I'm new to the terminology.

Additional info:

oo-admin-ctl-region has the same behavior.

Comment 2 Timothy Williams 2015-12-16 16:21:22 UTC
If the proposed changes in https://github.com/openshift/origin-server/pull/6337 are merged, we will need to ensure the documentation is updated to reflect these changes. The administration guide specifically must be updated.

Comment 3 openshift-github-bot 2015-12-22 18:45:44 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/78e1fc064b6ff6fe88c7fba479227939390259fc
Bug 1140816 - oo-admin-ctl-district missing documentation for listing districts

The 'oo-admin-ctl-district' doesn't have option to list all districts. Instead,
if command is executed without any parameters, the command will display a list
of districts. Also, the option 'list-available' is misleading as it displays a
list of available nodes, not districts. The 'oo-admin-ctl-district' experiences
the same behavior with displaying a list of regions when no options are selected.
This issue causes certainly confusions for those two commands.

This commit will explicitly display usage when user runs those commands without
parameters. A 'list' option is added to command list for 'oo-admin-ctl-district'
to allow user to display available districts. Also, 'list-available' is renamed
to nodes-available to clearly state which info will be displayed.

Bug 1140816
Link <https://bugzilla.redhat.com/show_bug.cgi?id=1140816>

Signed-off-by: Vu Dinh <vdinh>

Comment 6 Rory Thrasher 2016-02-22 22:36:23 UTC
QE,

Can we verify that the oo-admin-ctl-district command has been updated?

1. oo-admin-ctl-district 
With no arguments, it should display the options like --help.

2. oo-admin-ctl-district list
This new option should display all available districts

3. oo-admin-ctl-district nodes-available
This option, formerly list-available, should list the available nodes.


Puddle:http://etherpad.corp.redhat.com/puddle-2-2-2016-02-19

Thank you

Comment 7 Johnny Liu 2016-02-26 11:09:18 UTC
Verified this bug with openshift-origin-broker-util-1.37.5.2-1.el6op.noarch, and PASS.

# oo-admin-ctl-region
== Synopsis

oo-admin-ctl-region: Control regions and zones

== Usage

oo-admin-ctl-region OPTIONS

Options:
-c|--command <command>
    (create|update|destroy|add-zone|remove-zone|list)
-r|--region <region_name>
    Region name (alphanumeric, underscore, hyphen, dot)
-d|--description <region_description>
    Region description to apply on create or update
    Optional on create command and required on update command
-z|--zone <zone_name>
    Zone name within the given region (alphanumeric, underscore, hyphen, dot)
    Only valid for add-zone and remove-zone commands
-b|--bypass
    Ignore warnings
-h|--help
    Show usage info



# oo-admin-ctl-district
== Synopsis

oo-admin-ctl-district: Control districts

== Usage

oo-admin-ctl-district OPTIONS

Options:
-c|--command <command>
    (list|nodes-available|create|add-node|set-region|unset-region|deactivate-node|activate-node|remove-node|add-capacity|remove-capacity|destroy|publish-uids)
-u|--uuid <district uuid>
    District uuid  (alphanumeric)
-n|--name <district name>
    District name (Used on create or in place of uuid on other commands)
    Allowed chars: alphanumeric, underscore, hyphen, dot
-p|--node_profile <gear_size>
    Only required for create
-i|--server_identity
    Node server identity (i.e., its hostname; also may be
    a comma-separated list or a regex enclosed in slashes) (required)
-a|--available
    On add-node, add all available nodes with the right profile
-r|--region <region_name>
    Region name of the server identity.
    Only valid for add-node (optional) and set-region
-z|--zone <zone_name>
    Zone within the region. Only valid when region is specified
-s|--size
    Amount of capacity to add or remove (positive number) (required)
-o|--platform
    Specify the platform of the district, default value is Linux
-b|--bypass
    Ignore warnings
-h|--help
    Show usage info


# oo-admin-ctl-district -c list


{"_id"=>"56cfe83982611d0418000001",
 "active_servers_size"=>2,
 "available_capacity"=>6000,
 "available_uids"=>"<6000 uids hidden>",
 "created_at"=>2016-02-26 05:52:57 UTC,
 "gear_size"=>"small",
 "max_capacity"=>6000,
 "max_uid"=>6999,
 "name"=>"default-small",
 "platform"=>"Linux",
 "servers"=>
  [{"_id"=>"56cfe83f82611d0418000002",
    "active"=>true,
    "name"=>"node2.ose22-auto.com.cn",
    "unresponsive"=>false},
   {"_id"=>"56cfe83f82611d0418000003",
    "active"=>true,
    "name"=>"node1.ose22-auto.com.cn",
    "unresponsive"=>false}],
 "updated_at"=>2016-02-26 05:52:57 UTC,
 "uuid"=>"56cfe83982611d0418000001"}


{"_id"=>"56cfe84782611d0136000001",
 "active_servers_size"=>1,
 "available_capacity"=>6000,
 "available_uids"=>"<6000 uids hidden>",
 "created_at"=>2016-02-26 05:53:11 UTC,
 "gear_size"=>"medium",
 "max_capacity"=>6000,
 "max_uid"=>6999,
 "name"=>"default-medium",
 "platform"=>"Linux",
 "servers"=>
  [{"_id"=>"56cfe84d82611d0136000002",
    "active"=>true,
    "name"=>"broker.ose22-auto.com.cn",
    "unresponsive"=>false}],
 "updated_at"=>2016-02-26 05:53:11 UTC,
 "uuid"=>"56cfe84782611d0136000001"}


{"_id"=>"56cfe85682611d3246000001",
 "uuid"=>"56cfe85682611d3246000001",
 "available_uids"=>"<6000 uids hidden>",
 "name"=>"default-large",
 "platform"=>"Linux",
 "gear_size"=>"large",
 "available_capacity"=>6000,
 "max_uid"=>6999,
 "max_capacity"=>6000,
 "active_servers_size"=>0,
 "updated_at"=>2016-02-26 05:53:26 UTC,
 "created_at"=>2016-02-26 05:53:26 UTC}


Remove node1.ose22-auto.com.cn from district to make it available.

[root@broker ~]# oo-admin-ctl-district -c list-available
Command must be one of: list|nodes-available|create|add-node|set-region|unset-region|deactivate-node|activate-node|remove-node|add-capacity|remove-capacity|destroy|publish-uids
[root@broker ~]# oo-admin-ctl-district -c nodes-available
Nodes in profile: small
	node1.ose22-auto.com.cn

Comment 9 errata-xmlrpc 2016-03-22 16:50:55 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.

https://rhn.redhat.com/errata/RHSA-2016-0489.html


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