Browse Source

Merge "Fix hypervisors paginted collection_name." into stable/rocky

changes/87/713187/1
Zuul 3 months ago
committed by Gerrit Code Review
parent
commit
18032072d4
10 changed files with 15 additions and 15 deletions
  1. +1
    -1
      doc/api_samples/os-hypervisors/v2.33/hypervisors-detail-resp.json
  2. +1
    -1
      doc/api_samples/os-hypervisors/v2.33/hypervisors-list-resp.json
  3. +1
    -1
      doc/api_samples/os-hypervisors/v2.53/hypervisors-detail-resp.json
  4. +1
    -1
      doc/api_samples/os-hypervisors/v2.53/hypervisors-list-resp.json
  5. +1
    -1
      nova/api/openstack/compute/views/hypervisors.py
  6. +1
    -1
      nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.33/hypervisors-detail-resp.json.tpl
  7. +1
    -1
      nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.33/hypervisors-list-resp.json.tpl
  8. +1
    -1
      nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-detail-resp.json.tpl
  9. +1
    -1
      nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-list-resp.json.tpl
  10. +6
    -6
      nova/tests/unit/api/openstack/compute/test_hypervisors.py

+ 1
- 1
doc/api_samples/os-hypervisors/v2.33/hypervisors-detail-resp.json View File

@@ -42,7 +42,7 @@
],
"hypervisors_links": [
{
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/hypervisors/detail?limit=1&marker=2",
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/os-hypervisors/detail?limit=1&marker=2",
"rel": "next"
}
]


+ 1
- 1
doc/api_samples/os-hypervisors/v2.33/hypervisors-list-resp.json View File

@@ -9,7 +9,7 @@
],
"hypervisors_links": [
{
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/hypervisors?limit=1&marker=2",
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/os-hypervisors?limit=1&marker=2",
"rel": "next"
}
]


+ 1
- 1
doc/api_samples/os-hypervisors/v2.53/hypervisors-detail-resp.json View File

@@ -42,7 +42,7 @@
],
"hypervisors_links": [
{
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/hypervisors/detail?limit=1&marker=1bb62a04-c576-402c-8147-9e89757a09e3",
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/os-hypervisors/detail?limit=1&marker=1bb62a04-c576-402c-8147-9e89757a09e3",
"rel": "next"
}
]


+ 1
- 1
doc/api_samples/os-hypervisors/v2.53/hypervisors-list-resp.json View File

@@ -9,7 +9,7 @@
],
"hypervisors_links": [
{
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/hypervisors?limit=1&marker=1bb62a04-c576-402c-8147-9e89757a09e3",
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/os-hypervisors?limit=1&marker=1bb62a04-c576-402c-8147-9e89757a09e3",
"rel": "next"
}
]


+ 1
- 1
nova/api/openstack/compute/views/hypervisors.py View File

@@ -17,7 +17,7 @@ from nova.api.openstack import common


class ViewBuilder(common.ViewBuilder):
_collection_name = "hypervisors"
_collection_name = "os-hypervisors"

def get_links(self, request, hypervisors, detail=False):
coll_name = (self._collection_name + '/detail' if detail else


+ 1
- 1
nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.33/hypervisors-detail-resp.json.tpl View File

@@ -42,7 +42,7 @@
],
"hypervisors_links": [
{
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/hypervisors/detail?limit=1&marker=2",
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/os-hypervisors/detail?limit=1&marker=2",
"rel": "next"
}
]


+ 1
- 1
nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.33/hypervisors-list-resp.json.tpl View File

@@ -9,7 +9,7 @@
],
"hypervisors_links": [
{
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/hypervisors?limit=1&marker=2",
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/os-hypervisors?limit=1&marker=2",
"rel": "next"
}
]


+ 1
- 1
nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-detail-resp.json.tpl View File

@@ -42,7 +42,7 @@
],
"hypervisors_links": [
{
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/hypervisors/detail?limit=1&marker=%(hypervisor_id)s",
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/os-hypervisors/detail?limit=1&marker=%(hypervisor_id)s",
"rel": "next"
}
]


+ 1
- 1
nova/tests/functional/api_sample_tests/api_samples/os-hypervisors/v2.53/hypervisors-list-resp.json.tpl View File

@@ -9,7 +9,7 @@
],
"hypervisors_links": [
{
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/hypervisors?limit=1&marker=%(hypervisor_id)s",
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/os-hypervisors?limit=1&marker=%(hypervisor_id)s",
"rel": "next"
}
]


+ 6
- 6
nova/tests/unit/api/openstack/compute/test_hypervisors.py View File

@@ -833,7 +833,7 @@ class HypervisorsTestV233(HypervisorsTestV228):
'status': 'enabled'}
],
'hypervisors_links': [
{'href': 'http://localhost/v2/hypervisors?limit=1&marker=2',
{'href': 'http://localhost/v2/os-hypervisors?limit=1&marker=2',
'rel': 'next'}
]
}
@@ -894,7 +894,7 @@ class HypervisorsTestV233(HypervisorsTestV228):
'status': 'enabled'}
],
'hypervisors_links': [
{'href': 'http://localhost/v2/hypervisors?limit=1&marker=2',
{'href': 'http://localhost/v2/os-hypervisors?limit=1&marker=2',
'rel': 'next'}
]
}
@@ -907,7 +907,7 @@ class HypervisorsTestV233(HypervisorsTestV228):
req = self._get_request(
True, '/v2/1234/os-hypervisors/detail?limit=1&marker=1')
result = self.controller.detail(req)
link = 'http://localhost/v2/hypervisors/detail?limit=1&marker=2'
link = 'http://localhost/v2/os-hypervisors/detail?limit=1&marker=2'
expected = {
'hypervisors': [
{'cpu_info': {'arch': 'x86_64',
@@ -1009,7 +1009,7 @@ class HypervisorsTestV233(HypervisorsTestV228):
self.assertEqual(expected, result['hypervisors'])

def test_detail_pagination_with_additional_filter(self):
link = 'http://localhost/v2/hypervisors/detail?limit=1&marker=2'
link = 'http://localhost/v2/os-hypervisors/detail?limit=1&marker=2'
expected = {
'hypervisors': [
{'cpu_info': {'arch': 'x86_64',
@@ -1343,7 +1343,7 @@ class HypervisorsTestV253(HypervisorsTestV252):
url='/os-hypervisors/detail?limit=1&marker=%s' %
TEST_HYPERS_OBJ[0].uuid)
result = self.controller.detail(req)
link = ('http://localhost/v2/hypervisors/detail?limit=1&marker=%s' %
link = ('http://localhost/v2/os-hypervisors/detail?limit=1&marker=%s' %
TEST_HYPERS_OBJ[1].uuid)
expected = {
'hypervisors': [
@@ -1419,7 +1419,7 @@ class HypervisorsTestV253(HypervisorsTestV252):
url='/os-hypervisors?limit=1&marker=%s' %
TEST_HYPERS_OBJ[0].uuid)
result = self.controller.index(req)
link = ('http://localhost/v2/hypervisors?limit=1&marker=%s' %
link = ('http://localhost/v2/os-hypervisors?limit=1&marker=%s' %
TEST_HYPERS_OBJ[1].uuid)
expected = {
'hypervisors': [{


Loading…
Cancel
Save