← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1606659] [NEW] add-tag Normal response code is 200, not 201

 

Public bug reported:

This is found at stable/mitaka release

According to networking API v2.0 extensions:
http://developer.openstack.org/api-ref/networking/v2-ext/index.html?expanded=add-a-tag-detail,confirm-a-tag-detail,remove-all-tags-detail,replace-all-tags-detail,remove-a-tag-detail#tag-extension-tags

API DOC:
##########
PUT /v2.0/{resource_type}/{resource_id}/tags/{tag}Add a tagclose
Adds a tag on the resource.

Error response codes:201,404,500,401,503,

Although the document did not specify normal response code is 200. It is
generally 200 to represent an successful operation.

The current response code is 201 when tag is added.

stack@falcon-devstack ~
$ ​neutron --debug tag-add --resource-type network --resource tempest-test-network--402537940 --tag xBlue
DEBUG: stevedore.extension found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token')
DEBUG: stevedore.extension found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken')
DEBUG: stevedore.extension found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode')
DEBUG: stevedore.extension found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password')
DEBUG: stevedore.extension found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password')
DEBUG: stevedore.extension found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword')
DEBUG: stevedore.extension found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token')
DEBUG: stevedore.extension found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token')
DEBUG: stevedore.extension found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password')
DEBUG: neutronclient.neutron.v2_0.tag.AddTag run(Namespace(request_format='json', resource=u'tempest-test-network--402537940', resource_type=u'network', tag=u'xBlue'))
DEBUG: keystoneauth.session REQ: curl -g -i -X GET http://10.34.57.68:5000/v2.0 -H "Accept: application/json" -H "User-Agent: keystoneauth1/2.4.0 python-requests/2.9.1 CPython/2.7.6"
DEBUG: keystoneauth.session RESP: [200] Content-Length: 337 Vary: X-Auth-Token Keep-Alive: timeout=5, max=100 Server: Apache/2.4.10 (Ubuntu) Connection: Keep-Alive Date: Tue, 26 Jul 2016 15:46:42 GMT Content-Type: application/json x-openstack-request-id: req-6dd80f57-ec78-4bdb-8d2b-a6f15e48211f 
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://10.34.57.68:5000/v2.0/";, "rel": "self"}, {"href": "http://docs.openstack.org/";, "type": "text/html", "rel": "describedby"}]}}

DEBUG: keystoneauth.identity.v2 Making authentication request to http://10.34.57.68:5000/v2.0/tokens
DEBUG: stevedore.extension found extension EntryPoint.parse('l2_gateway_connection = networking_l2gw.l2gatewayclient.l2gw_client_ext._l2_gateway_connection')
DEBUG: stevedore.extension found extension EntryPoint.parse('l2_gateway = networking_l2gw.l2gatewayclient.l2gw_client_ext._l2_gateway')
DEBUG: keystoneauth.session REQ: curl -g -i -X GET http://10.34.57.68:9696/v2.0/networks.json?fields=id&name=tempest-test-network--402537940 -H "User-Agent: python-neutronclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}a02258f9d970cdb9c1c2e483389f103d34134991"
DEBUG: keystoneauth.session RESP: [200] Date: Tue, 26 Jul 2016 15:46:42 GMT Connection: keep-alive Content-Type: application/json; charset=UTF-8 Content-Length: 62 X-Openstack-Request-Id: req-28ce177f-042d-488e-b595-370d263873fe 
RESP BODY: {"networks": [{"id": "2907e8e9-b825-4f53-bd1f-1a974edbc345"}]}

DEBUG: keystoneauth.session REQ: curl -g -i -X PUT http://10.34.57.68:9696/v2.0/networks/2907e8e9-b825-4f53-bd1f-1a974edbc345/tags/xBlue.json -H "User-Agent: python-neutronclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}a02258f9d970cdb9c1c2e483389f103d34134991"
DEBUG: keystoneauth.session RESP: [201] Date: Tue, 26 Jul 2016 15:46:42 GMT Connection: keep-alive Content-Type: application/json; charset=UTF-8 Content-Length: 4 X-Openstack-Request-Id: req-41f5dbc6-e04c-44b3-8aa8-b544a9a781e6 
RESP BODY: null

stack@falcon-devstack ~
$ ​neutron net-show 2907e8e9-b825-4f53-bd1f-1a974edbc345
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | True                                 |
| availability_zone_hints |                                      |
| availability_zones      | default                              |
| created_at              | 2016-07-20T15:25:44                  |
| description             |                                      |
| id                      | 2907e8e9-b825-4f53-bd1f-1a974edbc345 |
| name                    | tempest-test-network--402537940      |
| port_security_enabled   | True                                 |
| router:external         | False                                |
| shared                  | False                                |
| status                  | ACTIVE                               |
| subnets                 | 98f0c38e-ab62-4dfa-b12c-2726c8f88afc |
| tags                    | xBlue                                |
|                         | blueX                                |
| tenant_id               | e70cf90734064b00aa073962b5321a80     |
| updated_at              | 2016-07-20T15:25:44                  |
+-------------------------+--------------------------------------+

** Affects: neutron
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1606659

Title:
  add-tag Normal response code is 200, not 201

Status in neutron:
  New

Bug description:
  This is found at stable/mitaka release

  According to networking API v2.0 extensions:
  http://developer.openstack.org/api-ref/networking/v2-ext/index.html?expanded=add-a-tag-detail,confirm-a-tag-detail,remove-all-tags-detail,replace-all-tags-detail,remove-a-tag-detail#tag-extension-tags

  API DOC:
  ##########
  PUT /v2.0/{resource_type}/{resource_id}/tags/{tag}Add a tagclose
  Adds a tag on the resource.

  Error response codes:201,404,500,401,503,

  Although the document did not specify normal response code is 200. It
  is generally 200 to represent an successful operation.

  The current response code is 201 when tag is added.

  stack@falcon-devstack ~
  $ ​neutron --debug tag-add --resource-type network --resource tempest-test-network--402537940 --tag xBlue
  DEBUG: stevedore.extension found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token')
  DEBUG: stevedore.extension found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken')
  DEBUG: stevedore.extension found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode')
  DEBUG: stevedore.extension found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password')
  DEBUG: stevedore.extension found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password')
  DEBUG: stevedore.extension found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword')
  DEBUG: stevedore.extension found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token')
  DEBUG: stevedore.extension found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token')
  DEBUG: stevedore.extension found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password')
  DEBUG: neutronclient.neutron.v2_0.tag.AddTag run(Namespace(request_format='json', resource=u'tempest-test-network--402537940', resource_type=u'network', tag=u'xBlue'))
  DEBUG: keystoneauth.session REQ: curl -g -i -X GET http://10.34.57.68:5000/v2.0 -H "Accept: application/json" -H "User-Agent: keystoneauth1/2.4.0 python-requests/2.9.1 CPython/2.7.6"
  DEBUG: keystoneauth.session RESP: [200] Content-Length: 337 Vary: X-Auth-Token Keep-Alive: timeout=5, max=100 Server: Apache/2.4.10 (Ubuntu) Connection: Keep-Alive Date: Tue, 26 Jul 2016 15:46:42 GMT Content-Type: application/json x-openstack-request-id: req-6dd80f57-ec78-4bdb-8d2b-a6f15e48211f 
  RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://10.34.57.68:5000/v2.0/";, "rel": "self"}, {"href": "http://docs.openstack.org/";, "type": "text/html", "rel": "describedby"}]}}

  DEBUG: keystoneauth.identity.v2 Making authentication request to http://10.34.57.68:5000/v2.0/tokens
  DEBUG: stevedore.extension found extension EntryPoint.parse('l2_gateway_connection = networking_l2gw.l2gatewayclient.l2gw_client_ext._l2_gateway_connection')
  DEBUG: stevedore.extension found extension EntryPoint.parse('l2_gateway = networking_l2gw.l2gatewayclient.l2gw_client_ext._l2_gateway')
  DEBUG: keystoneauth.session REQ: curl -g -i -X GET http://10.34.57.68:9696/v2.0/networks.json?fields=id&name=tempest-test-network--402537940 -H "User-Agent: python-neutronclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}a02258f9d970cdb9c1c2e483389f103d34134991"
  DEBUG: keystoneauth.session RESP: [200] Date: Tue, 26 Jul 2016 15:46:42 GMT Connection: keep-alive Content-Type: application/json; charset=UTF-8 Content-Length: 62 X-Openstack-Request-Id: req-28ce177f-042d-488e-b595-370d263873fe 
  RESP BODY: {"networks": [{"id": "2907e8e9-b825-4f53-bd1f-1a974edbc345"}]}

  DEBUG: keystoneauth.session REQ: curl -g -i -X PUT http://10.34.57.68:9696/v2.0/networks/2907e8e9-b825-4f53-bd1f-1a974edbc345/tags/xBlue.json -H "User-Agent: python-neutronclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}a02258f9d970cdb9c1c2e483389f103d34134991"
  DEBUG: keystoneauth.session RESP: [201] Date: Tue, 26 Jul 2016 15:46:42 GMT Connection: keep-alive Content-Type: application/json; charset=UTF-8 Content-Length: 4 X-Openstack-Request-Id: req-41f5dbc6-e04c-44b3-8aa8-b544a9a781e6 
  RESP BODY: null

  stack@falcon-devstack ~
  $ ​neutron net-show 2907e8e9-b825-4f53-bd1f-1a974edbc345
  +-------------------------+--------------------------------------+
  | Field                   | Value                                |
  +-------------------------+--------------------------------------+
  | admin_state_up          | True                                 |
  | availability_zone_hints |                                      |
  | availability_zones      | default                              |
  | created_at              | 2016-07-20T15:25:44                  |
  | description             |                                      |
  | id                      | 2907e8e9-b825-4f53-bd1f-1a974edbc345 |
  | name                    | tempest-test-network--402537940      |
  | port_security_enabled   | True                                 |
  | router:external         | False                                |
  | shared                  | False                                |
  | status                  | ACTIVE                               |
  | subnets                 | 98f0c38e-ab62-4dfa-b12c-2726c8f88afc |
  | tags                    | xBlue                                |
  |                         | blueX                                |
  | tenant_id               | e70cf90734064b00aa073962b5321a80     |
  | updated_at              | 2016-07-20T15:25:44                  |
  +-------------------------+--------------------------------------+

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1606659/+subscriptions


Follow ups