Document Bug: service API works different than github doc (documented find by name but code work by type) - Openstack CLI

Bug #1418830 reported by apal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Low
Steve Martinelli

Bug Description

In the document it's said:
https://github.com/openstack/keystone/blob/master/doc/source/cli_examples.rst
Services
service create
positional arguments:
<service-name> New service name
optional arguments:
--type <service-type> New service type (compute, image, identity, volume, etc)
--description <service-description> New service description
example:
$ openstack service create nova --type compute --description "Nova Compute Service"
But during test, openstack CLI can only find service by 'Type' but not 'Name'. Is it a doc issue or code issue?
Here's the testing:
(test_venv)cetest@cer106n0001:~/ysong/ysong$ openstack service list
----------------------------------------------------------------+
ID Name Type Enabled
----------------------------------------------------------------+
095c0ff1e4be4126aad6f0a2270db4c4 ceilometer metering True
0bf8d9ffa1ad489093f861731bf36e3f heat orchestration True
270bd87014f34142af9a4ce97d85517d sherpa hp-catalog True
34aad9f100194ef0b0f0b819cd418371 keystone identity True
50b54b4a8a88426e841be4f0dda3967b nova computev3 True
96084d6e48eb40e8b19df15ab33d3d35 glance image True
aada972fb0bb4021b46236bc13dfb832 swift object-store True
b2789fb971574f2d82ae9edecd062584 cinder volume True
ce17772214884cd0baff1611bbb0a07c neutron network True
eae5cc974ec94d649e24bcf19a406662 nova compute True
f2f1590d30d7451ba6a43f5a00a6b607 ec2 ec2 True
----------------------------------------------------------------+
(test_venv)cetest@cer106n0001:~/ysong/ysong$ openstack service show nova
ERROR: openstack No service with a type, name or ID of 'nova' exists.
(test_venv)cetest@cer106n0001:~/ysong/ysong$ openstack service create test --type compute --description test
usage: openstack service create [-h] [-f
{shell,table,value}] [-c COLUMN]
[--max-width <integer>] [--prefix PREFIX]
[--name <service-name>] [--enable | --disable]
<service-type>
openstack service create: error: unrecognized arguments: --type compute --description test
(test_venv)cetest@cer106n0001:~/ysong/ysong$ openstack service create compute --name Test --description test
usage: openstack service create [-h] [-f {shell,table,value}
] [-c COLUMN]
[--max-width <integer>] [--prefix PREFIX]
[--name <service-name>] [--enable | --disable]
<service-type>
openstack service create: error: unrecognized arguments: --description test
(test_venv)cetest@cer106n0001:~/ysong/ysong$ openstack service create compute --name Test
-----------------------------------------+
Field Value
-----------------------------------------+
enabled True
id f38310d398b44513b46e8a3eacda4f9a
name Test
type compute
-----------------------------------------+
(test_venv)cetest@cer106n0001:~/ysong/ysong$ openstack service list
----------------------------------------------------------------+
ID Name Type Enabled
----------------------------------------------------------------+
095c0ff1e4be4126aad6f0a2270db4c4 ceilometer metering True
0bf8d9ffa1ad489093f861731bf36e3f heat orchestration True
270bd87014f34142af9a4ce97d85517d sherpa hp-catalog True
34aad9f100194ef0b0f0b819cd418371 keystone identity True
50b54b4a8a88426e841be4f0dda3967b nova computev3 True
96084d6e48eb40e8b19df15ab33d3d35 glance image True
aada972fb0bb4021b46236bc13dfb832 swift object-store True
b2789fb971574f2d82ae9edecd062584 cinder volume True
ce17772214884cd0baff1611bbb0a07c neutron network True
eae5cc974ec94d649e24bcf19a406662 nova compute True
f2f1590d30d7451ba6a43f5a00a6b607 ec2 ec2 True
f38310d398b44513b46e8a3eacda4f9a Test compute True
----------------------------------------------------------------+
(test_venv)cetest@cer106n0001:~/ysong/ysong$ openstack service delete f38310d398b44513b46e8a3eacda4f9a
(test_venv)cetest@cer106n0001:~/ysong/ysong$ openstack service show compute //show by 'Type' too
---------------------------------------------+
Field Value
---------------------------------------------+
description Nova Compute Service
enabled True
id eae5cc974ec94d649e24bcf19a406662
name nova
type compute
---------------------------------------------+
(test_venv)cetest@cer106n0001:~/ysong/ysong$ openstack service show nova
ERROR: openstack No service with a type, name or ID of 'nova' exists.

(openstack) service list
----------------------------------------------------------------+
ID Name Type Enabled
----------------------------------------------------------------+
0e28690b0f9e4b7d8935027ab3f426cf neutron network True
57fa94acbef24782b64069035374a7b3 cinder volume True
827eba724d814920b34fa7196bb09432 sherpa hp-catalog True
90ebb68d1fce4dd99bd37ab0e749a022 nova computev3 True
9af969e39ed6472c88886e35168e7711 heat orchestration True
a5d024efb2744863b634f69cff8c49d2 swift object-store True
d0f10646192a428dae4471d0226256f6 nova compute True
d1300e097ee84bb781cee8fc47c0c623 ec2 ec2 True
e40cc3fb58114844a9dfe0af3ded9745 glance image True
f1125f4546a8473aa63c91c6ea655755 ceilometer metering True
fd2a2d4b7382444691bea723851c2202 keystone identity True
----------------------------------------------------------------+
(openstack) service show nova
ERROR: openstack No service with a type, name or ID of 'nova' exists.
(openstack) service show compute
---------------------------------------------+
Field Value
---------------------------------------------+
description Nova Compute Service
enabled True
id d0f10646192a428dae4471d0226256f6
name nova
type compute
---------------------------------------------+
(openstack) service create apal-test --type compute --description test
usage: service create [-h] [-f
{html,json,shell,table,value,yaml}] [-c COLUMN]
[--max-width <integer>] [--prefix PREFIX]
[--name <service-name>] [--enable | --disable]
<service-type>
service create: error: unrecognized arguments: --type compute --description test
(openstack) service create apal-test --type nova
usage: service create [-h] [-f {html,json,shell,table,value,yaml}
] [-c COLUMN]
[--max-width <integer>] [--prefix PREFIX]
[--name <service-name>] [--enable | --disable]
<service-type>
service create: error: unrecognized arguments: --type nova
(openstack) service create compute --name apal-test
-----------------------------------------+
Field Value
-----------------------------------------+
enabled True
id 14b9130458cd41be95140c1c3ce6eab3
name apal-test
type compute
-----------------------------------------+
(openstack) service delete 14b9130458cd41be95140c1c3ce6eab3
(openstack) service list
----------------------------------------------------------------+
ID Name Type Enabled
----------------------------------------------------------------+
0e28690b0f9e4b7d8935027ab3f426cf neutron network True
57fa94acbef24782b64069035374a7b3 cinder volume True
827eba724d814920b34fa7196bb09432 sherpa hp-catalog True
90ebb68d1fce4dd99bd37ab0e749a022 nova computev3 True
9af969e39ed6472c88886e35168e7711 heat orchestration True
a5d024efb2744863b634f69cff8c49d2 swift object-store True
d0f10646192a428dae4471d0226256f6 nova compute True
d1300e097ee84bb781cee8fc47c0c623 ec2 ec2 True
e40cc3fb58114844a9dfe0af3ded9745 glance image True
f1125f4546a8473aa63c91c6ea655755 ceilometer metering True
fd2a2d4b7382444691bea723851c2202 keystone identity True
----------------------------------------------------------------+
(openstack)

Revision history for this message
Steve Martinelli (stevemar) wrote :

Refer to http://docs.openstack.org/developer/python-openstackclient/command-list.html for the canonical source of truth for all openstackclient commands. I'll use this bug to remove the OSC related commands in the Keystone docs and add a link to: http://docs.openstack.org/developer/python-openstackclient/command-list.html

specifically look at http://docs.openstack.org/developer/python-openstackclient/command-objects/service.html for service related content

Changed in keystone:
assignee: nobody → Steve Martinelli (stevemar)
status: New → Triaged
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/158202

Changed in keystone:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/158202
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=23fa79a318757d23b7db1e2cb520066b1de6a095
Submitter: Jenkins
Branch: master

commit 23fa79a318757d23b7db1e2cb520066b1de6a095
Author: Steve Martinelli <email address hidden>
Date: Mon Feb 23 02:00:19 2015 -0500

    Reference OSC docs in CLI examples

    Reference the openstackclient's documentation rather than keeping
    our own examples, since it's the canonical source.

    Change-Id: I47c7c9201fdebe9905ca06c1d5e1ef97fd6c7523
    Closes-Bug: #1418830

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: kilo-3 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.