← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1765452] Re: Unable to use project_id as sort_key

 

Reviewed:  https://review.openstack.org/563331
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=f213ba487b104e00048c5aeda52a04043413d51d
Submitter: Zuul
Branch:    master

commit f213ba487b104e00048c5aeda52a04043413d51d
Author: Hongbin Lu <hongbin.lu@xxxxxxxxxx>
Date:   Fri Apr 20 22:29:30 2018 +0000

    Populate project info before using it
    
    Sorting and filtering will rely on the attributes information. It is
    necessary to populate project info before using it to sort/filter.
    
    Closes-Bug: #1765452
    Change-Id: Ife90268530b6e86a0b0d213e4742a2ef81cb2395


** Changed in: neutron
       Status: In Progress => Fix Released

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

Title:
  Unable to use project_id as sort_key

Status in neutron:
  Fix Released

Bug description:
  List any neutron resource and sort the list result with 'project_id'
  as a sort_key. Neutron will return error. However, sorting with
  'tenant_id' is working so the API behavior is asymmetric and odd.

  * We cannot sort by 'project_id'

  $ sudo systemctl restart devstack@q-*
  $ curl -g -X GET "http://10.0.0.15:9696/v2.0/networks?sort_dir=asc&sort_key=project_id"; -H "Accept: application/json" -H "X-Auth-Token: $TOKEN"
  {"NeutronError": {"message": "[u'project_id'] is invalid attribute for sort_keys", "type": "HTTPBadRequest", "detail": ""}}

  * Sort by 'tenant_id' has no problem

  $ sudo systemctl restart devstack@q-*
  $ curl -g -X GET "http://10.0.0.15:9696/v2.0/networks?sort_dir=asc&sort_key=tenant_id"; -H "Accept: application/json" -H "X-Auth-Token: $TOKEN"
  {"networks":[{"ipv6_address_scope":null,"dns_domain":"","revision_number":3,"port_security_enabled":true,"id":"3becdf9f-429b-4e9d-9856-403a5c8582de","router:external":false,"availability_zone_hints":[],"availability_zones":[],"ipv4_address_scope":null,"shared":true,"project_id":"a7a7fa10fd7a4c80acb7e4b224480495","l2_adjacency":true,"status":"ACTIVE","subnets":[],"description":"","tags":[],"updated_at":"2018-04-12T20:45:07Z","qos_policy_id":null,"name":"secret_network","admin_state_up":true,"tenant_id":"a7a7fa10fd7a4c80acb7e4b224480495","created_at":"2018-04-12T20:43:33Z","mtu":1450},{"updated_at":"2018-03-19T19:17:21Z","dns_domain":"","revision_number":7,"port_security_enabled":true,"id":"ad93b454-4836-46c7-bfc8-64a20a2ab95a","router:external":true,"availability_zone_hints":[],"availability_zones":["nova"],"ipv4_address_scope":null,"shared":false,"project_id":"a7a7fa10fd7a4c80acb7e4b224480495","l2_adjacency":true,"status":"ACTIVE","subnets":["c7b4904f-bf9b-4bd4-94e7-786a3d9d22fb","62d3fb30-082f-4ed1-93b8-286bd26e2530"],"description":"","tags":[],"ipv6_address_scope":null,"is_default":true,"qos_policy_id":null,"name":"public","admin_state_up":true,"tenant_id":"a7a7fa10fd7a4c80acb7e4b224480495","created_at":"2018-03-19T19:17:07Z","mtu":1500},{"ipv6_address_scope":null,"dns_domain":"","revision_number":4,"port_security_enabled":true,"id":"02dd8479-ef26-4398-a102-d19d0a7b3a1f","router:external":false,"availability_zone_hints":[],"availability_zones":["nova"],"ipv4_address_scope":null,"shared":false,"project_id":"b629c7f622ad4a7bbfc8fb0128cec046","l2_adjacency":true,"status":"ACTIVE","subnets":["49a703b8-e53e-420a-af20-3b30d6c73409","ae522c5a-7aea-4ce8-9412-73c0f5438cc4"],"description":"","tags":[],"updated_at":"2018-03-19T19:17:00Z","qos_policy_id":null,"name":"private","admin_state_up":true,"tenant_id":"b629c7f622ad4a7bbfc8fb0128cec046","created_at":"2018-03-19T19:16:56Z","mtu":1450}]}

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


References