← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1864428] Fix included in openstack/nova rocky-eol

 

This issue was fixed in the openstack/nova rocky-eol  release.

** Changed in: nova/rocky
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1864428

Title:
  Hypervisors collection_name affects pagination query

Status in OpenStack Compute (nova):
  Fix Released
Status in OpenStack Compute (nova) rocky series:
  Fix Released
Status in OpenStack Compute (nova) stein series:
  Fix Released
Status in OpenStack Compute (nova) train series:
  Fix Released
Status in OpenStack SDK:
  New

Bug description:
  In nova, hypervisor view builder's collect_name is 'hypervisors':

  ```
  # nova.api.openstack.compute.views.hypervisors.ViewBuilder
  class ViewBuilder(common.ViewBuilder):
      _collection_name = "hypervisors"
   
      def get_links(self, request, hypervisors, detail=False):
          coll_name = (self._collection_name + '/detail' if detail else
                       self._collection_name)
          return self._get_collection_links(request, hypervisors, coll_name,
                                            'id')
  ```

  So when we do paginated query via openstacksdk, we would get response
  like this:

  ```
  {u'hypervisors': [{u'status': u'enabled', u'state': u'up', u'id': u'53fb5bdc-f9a4-4fc4-a4be-8eb33cd236b1', u'hypervisor_hostname': u'gd02-compute-11e115e64e19'}, {u'status': u'enabled', u'state': u'up', u'id': u'a4db6ea8-2a91-45e7-a4b4-cb26c2dbc514', u'hypervisor_hostname': u'gd02-compute-11e115e64e11'}, {u'status': u'enabled', u'state': u'up', u'id': u'd92c5452-ea75-4f58-8e0b-b4a6823850d8', u'hypervisor_hostname': u'gd02-compute-11e115e64e12'}], u'hypervisors_links': [{u'href': u'http://nova-api.cty.os:11010/v2.1/hypervisors?limit=3&marker=d92c5452-ea75-4f58-8e0b-b4a6823850d8', u'rel': u'next'}]}
  ```

  And openstacksdk uses wrong hypervisors_links to query next page, and
  get error:

  ```
  Traceback (most recent call last):
    File "p_hypervisors-admin.py", line 48, in <module>
      do_operation(limit, marker)
    File "p_hypervisors-admin.py", line 38, in do_operation
      srvs = [i for i in info]
    File "/usr/lib/python2.7/site-packages/openstack/resource.py", line 898, in list
      exceptions.raise_from_response(response)
    File "/usr/lib/python2.7/site-packages/openstack/exceptions.py", line 212, in raise_from_response
      http_status=http_status, request_id=request_id
  openstack.exceptions.NotFoundException: NotFoundException: 404: Client Error for url: http://nova-api.cty.os:11010/v2.1/hypervisors?limit=3&marker=ea9d857a-6328-47a8-abde-dc38972f4ca2, Not Found
  ```

  The right uri should be `/v2.1/os-hypervisors`

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



References