Fix os-keypairs pagination links

The API URL is '/os-keypairs', not '/keypairs'. Attempting to use these
pagination links as-is will result in a HTTP 404 (Not Found).

Conflicts:
	nova/api/openstack/compute/views/keypairs.py

NOTE(stephenfin): Conflict due to absence of change
I2820143b7b5b6f74a6c3ca67a5c9d0980e3e9a86, which we don't want to
backport.

Change-Id: Ic04568caecc138e6016418f6878d031c4a0d3fb4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #1866373
(cherry picked from commit f31efe0a0e)
This commit is contained in:
Stephen Finucane 2020-03-06 16:52:14 +00:00
parent 8c36c0ac8e
commit 93f903d794
5 changed files with 7 additions and 7 deletions

View File

@ -11,8 +11,8 @@
],
"keypairs_links": [
{
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/keypairs?limit=1&marker=keypair-5d935425-31d5-48a7-a0f1-e76e9813f2c3",
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/os-keypairs?limit=1&marker=keypair-5d935425-31d5-48a7-a0f1-e76e9813f2c3",
"rel": "next"
}
]
}
}

View File

@ -11,8 +11,8 @@
],
"keypairs_links": [
{
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/keypairs?limit=1&marker=keypair-5d935425-31d5-48a7-a0f1-e76e9813f2c3&user_id=user2",
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/os-keypairs?limit=1&marker=keypair-5d935425-31d5-48a7-a0f1-e76e9813f2c3&user_id=user2",
"rel": "next"
}
]
}
}

View File

@ -18,7 +18,7 @@ from nova.api.openstack import common
class ViewBuilder(common.ViewBuilder):
_collection_name = "keypairs"
_collection_name = 'os-keypairs'
def get_links(self, request, keypairs):
return self._get_collection_links(request, keypairs,

View File

@ -11,7 +11,7 @@
],
"keypairs_links": [
{
"href": "%(versioned_compute_endpoint)s/keypairs?limit=1&marker=%(keypair_name)s",
"href": "%(versioned_compute_endpoint)s/os-keypairs?limit=1&marker=%(keypair_name)s",
"rel": "next"
}
]

View File

@ -11,7 +11,7 @@
],
"keypairs_links": [
{
"href": "%(versioned_compute_endpoint)s/keypairs?limit=1&marker=%(keypair_name)s&user_id=user2",
"href": "%(versioned_compute_endpoint)s/os-keypairs?limit=1&marker=%(keypair_name)s&user_id=user2",
"rel": "next"
}
]