Bug 1052829

Summary: [fork] Options to oo-admin-ctl-cartridge in help doc and man page are out-of-sync.
Product: OpenShift Online Reporter: Liang Xia <lxia>
Component: PodAssignee: Clayton Coleman <ccoleman>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: ccoleman
Target Milestone: ---   
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-30 00:55:35 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:

Description Liang Xia 2014-01-14 07:05:53 UTC
Description of problem:
Check the help doc and man page of oo-admin-ctl-cartridge, 
some options listed in help doc are missing in man page,
while some others listed in man page are missing in help doc.

And the refresh command show invalid argument.
# oo-admin-ctl-cartridge -c refresh
/usr/sbin/oo-admin-ctl-cartridge:314:in `<main>': invalid argument: -c refresh (OptionParser::InvalidArgument)
# oo-admin-ctl-cartridge --command refresh
/usr/sbin/oo-admin-ctl-cartridge:314:in `<main>': invalid argument: --command refresh (OptionParser::InvalidArgument)

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

How reproducible:
always

Steps to Reproduce:
1.Launch a instance and ssh into it.
2.Check help doc and man page of oo-admin-ctl-cartridge.
3.

Actual results:
As decription.

Expected results:
Options to oo-admin-ctl-cartridge shoud be sync in help doc and man page.

Additional info:
# oo-admin-ctl-cartridge -h
== Synopsis
oo-admin-ctl-cartridge: Manage cartridges
Commands:
 activate    - Make a specific cartridge active
 deactivate  - Disable a cartridge from being visible to users
 clean       - Delete all cartridges in the broker
 delete      - Remove one or more named cartridges
 import      - Import a manifest as one or more cartridges
 import-node - Import the latest cartridges from the nodes
 list        - List all cartridges
For delete, activate, and deactivate, you may pass a file containing ids or names.
== Usage: oo-admin-ctl-cartridge -c (activate|clean|deactivate|delete|import|import-node|list)
    -c, --command COMMAND            A command to execute
        --broker PATH                The path to the broker (default /var/www/openshift/broker/config/environment)
        --raw                        Dump all cartridge information as JSON
        --force                      Confirm potentially destructive actions
    -a, --active                     Show only active cartridges
        --activate                   Mark imported or updated cartridges as active.
        --name NAMES                 Comma-delimited cartridge names.
    -q                               Display only ids
        --ids IDS                    ID for a cartridge version to activate or deactivate (comma-delimited).
        --node NODE                  Identifier for a node (server-identity) to import from.
    -u, --url URL                    URL of a cartrige manifest to import.
    -h, --help                       Show this message

# man oo-admin-ctl-cartridge
NAME
       oo-admin-ctl-cartridge
SYNOPSIS
       oo-admin-ctl-cartridge [ --command (refresh|clean|list) ] [ --help ]
DESCRIPTION
       This is an administrative utility to manage cartridges.
OPTIONS
       -h|--help Display a simple usage page.
       -c|--command COMMAND
           list - Display information about broker cartridges
           refresh - Update the broker cartridge collection with cartridges from a node.
           clean - Deletes all cartridges from the broker
           delete - Remove individual cartridge versions from the broker.  Specify one or
             more names using the ā€™-nā€™ option.
       --raw When outputting cartridge information, display each manifest as JSON
       -n|--name NAMES
              A comma-delimited list of cartridge names.
                     Used by the "delete" command.
EXAMPLE
       $ oo-admin-ctl-cartridge -c refresh
AUTHOR
       Clayton Coleman <ccoleman@redhat.com> - man page written for OpenShift Origin

Comment 1 Clayton Coleman 2014-01-16 19:31:26 UTC
Fixed in 63a108a6b04b947a3147507a332f71cdbafabc12 in the fork AMI branch, also made it so that obsolete cartridges are not automatically updated by oo-admin-ctl-cartridge.

Will rebuild a fork ami

Comment 2 Liang Xia 2014-01-17 05:24:55 UTC
Checked on fork_ami_origin_broker_184_cartridges_in_mongo_994,

in the man page of oo-admin-ctl-cartridge,
The EXAMPLE part show: "oo-admin-ctl-cartridge -c refresh", but we don't have refresh option.
And line "A comma-delimited list of cartridge names." in OPTIONS part should not in bold.

Comment 3 Clayton Coleman 2014-01-17 23:03:17 UTC
The first part is fixed.  The second part isn't something I'm explicitly generating - please spawn a separate bug for that since it's lower priority.

Comment 4 openshift-github-bot 2014-01-18 21:22:38 UTC
Commit pushed to master at https://github.com/openshift/li

https://github.com/openshift/li/commit/d4bd7b962fc029fb81684411e5f0890ea099ef78
Allow downloadable cartridges to appear in rhc cartridge list

Implements: Trello card origin_broker_184

An administrator can import a downloadable cartridge in the broker via a new
oo-admin-ctl-cartridge command.  That cartridge can then be specified by name
at creation time.  Some additional cleanup to unit tests and application
also pave the way for future improvements to elaboration and cartridge tagging.

Adds a unique index on db.applications [domain_id, name] to do uniqueness at
the mongo level.

Fixes: Bug 1052829 - Made help and man page identical for oo-admin-ctl-cartridge

Comment 5 openshift-github-bot 2014-01-18 21:22:38 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/99365c91545dbc501ae0a06b957a52fddd15f3d9
Allow downloadable cartridges to appear in rhc cartridge list

Implements: Trello card origin_broker_184

An administrator can import a downloadable cartridge in the broker via a new
oo-admin-ctl-cartridge command.  That cartridge can then be specified by name
at creation time.  Some additional cleanup to unit tests and application
also pave the way for future improvements to elaboration and cartridge tagging.

Adds a unique index on db.applications [domain_id, name] to do uniqueness at
the mongo level.

Fixes: Bug 1052829 - Made help and man page identical for oo-admin-ctl-cartridge

Comment 6 Liang Xia 2014-01-20 05:40:12 UTC
Verified on devenv_4242, 

The first issue mentioned in comment #2 has been fixed.
EXAMPLE
       $ oo-admin-ctl-cartridge -c list

The second issue mentioned in commet #2 will be tracked by https://bugzilla.redhat.com/show_bug.cgi?id=1055356 due to comment #3.

Move this bug to verified.