This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 890795

Summary: Quantum CLI net-create and port-create option "--admin-state-down" should be "--admin-state-up"
Product: Red Hat OpenStack Reporter: Ofer Blaut <oblaut>
Component: openstack-quantumAssignee: Gary Kotton <gkotton>
Status: CLOSED NOTABUG QA Contact: Ofer Blaut <oblaut>
Severity: low Docs Contact:
Priority: low    
Version: 2.0 (Folsom)CC: chrisw, gkotton, ykaul
Target Milestone: snapshot3Keywords: Triaged
Target Release: 2.0 Folsom   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-14 06:35:13 EST Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Ofer Blaut 2012-12-30 02:06:36 EST
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 15:36:45 EST
Needs upstream fix (and stable backport) before backport.  Should be easy enough
Comment 3 Gary Kotton 2013-01-29 03:15:26 EST
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 06:35:13 EST
This is not a bug and it is the way which the quantum cli works. We need to open a documentation bug