Bug 890795 - Quantum CLI net-create and port-create option "--admin-state-down" should be "--admin-state-up"
Summary: Quantum CLI net-create and port-create option "--admin-state-down" should be ...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-quantum
Version: 2.0 (Folsom)
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: snapshot3
: 2.0 Folsom
Assignee: Gary Kotton
QA Contact: Ofer Blaut
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-30 07:06 UTC by Ofer Blaut
Modified: 2016-04-26 19:01 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-14 11:35:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ofer Blaut 2012-12-30 07:06:36 UTC
Description of problem:

Quantum CLI net-create and port-create include option "--admin-state-down" which should be "--admin-state-up" according to API

http://wiki.openstack.org/Quantum/APIv2-specification#Create_Network


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


How reproducible:

Steps to Reproduce:
1.quantum net-create -h ( look for admin-state option
2.quantum port-create -h ( look for admin-state option
3.
  
Actual results:
"--admin-state-down"

Expected results:
"--admin-state-up"

Additional info:

Comment 2 Chris Wright 2013-01-03 20:36:45 UTC
Needs upstream fix (and stable backport) before backport.  Should be easy enough

Comment 3 Gary Kotton 2013-01-29 08:15:26 UTC
1. Please see the RED highlight below. By default the admin state of a port/network is up. The client displays the field as admin_state_up (this is a boolean value)

 quantum net-create -h
usage: quantum net-create [-h] [-f {shell,table}] [-c COLUMN]
                          [--variable VARIABLE] [--prefix PREFIX]
                          [--request-format {json,xml}]
                          [--tenant-id TENANT_ID] [--admin-state-down]
                          [--shared]
                          NAME

Create a network for a given tenant.

positional arguments:
  NAME                  Name of network to create

optional arguments:
  -h, --help            show this help message and exit
  --request-format {json,xml}
                        the xml or json request format
  --tenant-id TENANT_ID
                        the owner tenant ID
  --admin-state-down    Set Admin State Up to false
  --shared              Set the network as shared

output formatters:
  output formatter options

  -f {shell,table}, --format {shell,table}
                        the output format, defaults to table
  -c COLUMN, --column COLUMN
                        specify the column(s) to include, can be repeated

shell formatter:
  a format a UNIX shell can parse (variable="value")

  --variable VARIABLE   specify the variable(s) to include, can be repeated
  --prefix PREFIX       add a prefix to all variable names

2. In order to enable the user to create a network/port that is down a convenience argument (admin-state-down) was added. Internally this sets the value of admin_state_up to False. Please see below:

quantum net-create --admin-state-down chris
Created a new network:
+-----------------+--------------------------------------+
| Field           | Value                                |
+-----------------+--------------------------------------+
| admin_state_up  | False                                |
| id              | ee5c507a-eeeb-4519-8e01-87fe737c5dd9 |
| name            | chris                                |
| router:external | False                                |
| shared          | False                                |
| status          | ACTIVE                               |
| subnets         |                                      |
| tenant_id       | af4f4cb0fec74b01af31ded3968a37d3     |
+-----------------+--------------------------------------+

This could have alternatively be invoked by the user as:
quantum net-create ofer --admin_state_up=False
Created a new network:
+-----------------+--------------------------------------+
| Field           | Value                                |
+-----------------+--------------------------------------+
| admin_state_up  | False                                |
| id              | 8006fe50-4eec-4a03-91ca-03b4077ce884 |
| name            | ofer                                 |
| router:external | False                                |
| shared          | False                                |
| status          | ACTIVE                               |
| subnets         |                                      |
| tenant_id       | af4f4cb0fec74b01af31ded3968a37d3     |
+-----------------+--------------------------------------+

[Note that the first option was a lot more intuitive than the second]

3. The bug states that --admin-state-down should be --admin-state-up. By default it is up. This option was enabled to save the user a headache when creating the port and they wanted it to be down.

4. In my opinion the problem is the comment "  --admin-state-down    Set Admin State Up to false" this should just be "--admin-state-down Set Admin State to Down".

Comment 4 Gary Kotton 2013-02-14 11:35:13 UTC
This is not a bug and it is the way which the quantum cli works. We need to open a documentation bug


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