Merge "Bump the version to 1.4 for host list api control"
This commit is contained in:
@@ -51,7 +51,7 @@ class HostController(base.Controller):
|
|||||||
"""Host info controller"""
|
"""Host info controller"""
|
||||||
|
|
||||||
@pecan.expose('json')
|
@pecan.expose('json')
|
||||||
@base.Controller.api_version("1.3")
|
@base.Controller.api_version("1.4")
|
||||||
@exception.wrap_pecan_controller_exception
|
@exception.wrap_pecan_controller_exception
|
||||||
def get_all(self, **kwargs):
|
def get_all(self, **kwargs):
|
||||||
"""Retrieve a list of hosts"""
|
"""Retrieve a list of hosts"""
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class TestHostController(api_base.FunctionalTest):
|
|||||||
mock_host_list.return_value = hosts
|
mock_host_list.return_value = hosts
|
||||||
|
|
||||||
extra_environ = {'HTTP_ACCEPT': 'application/json'}
|
extra_environ = {'HTTP_ACCEPT': 'application/json'}
|
||||||
headers = {'OpenStack-API-Version': 'container 1.3'}
|
headers = {'OpenStack-API-Version': 'container 1.4'}
|
||||||
response = self.app.get('/v1/hosts/', extra_environ=extra_environ,
|
response = self.app.get('/v1/hosts/', extra_environ=extra_environ,
|
||||||
headers=headers)
|
headers=headers)
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ class TestHostController(api_base.FunctionalTest):
|
|||||||
host_list.append(host)
|
host_list.append(host)
|
||||||
mock_host_list.return_value = host_list[-1:]
|
mock_host_list.return_value = host_list[-1:]
|
||||||
extra_environ = {'HTTP_ACCEPT': 'application/json'}
|
extra_environ = {'HTTP_ACCEPT': 'application/json'}
|
||||||
headers = {'OpenStack-API-Version': 'container 1.3'}
|
headers = {'OpenStack-API-Version': 'container 1.4'}
|
||||||
response = self.app.get('/v1/hosts/?limit=3&marker=%s'
|
response = self.app.get('/v1/hosts/?limit=3&marker=%s'
|
||||||
% host_list[2].uuid,
|
% host_list[2].uuid,
|
||||||
extra_environ=extra_environ, headers=headers)
|
extra_environ=extra_environ, headers=headers)
|
||||||
@@ -83,7 +83,7 @@ class TestHostEnforcement(api_base.FunctionalTest):
|
|||||||
|
|
||||||
def test_policy_disallow_get_all(self):
|
def test_policy_disallow_get_all(self):
|
||||||
extra_environ = {'HTTP_ACCEPT': 'application/json'}
|
extra_environ = {'HTTP_ACCEPT': 'application/json'}
|
||||||
headers = {'OpenStack-API-Version': 'container 1.3'}
|
headers = {'OpenStack-API-Version': 'container 1.4'}
|
||||||
self._common_policy_check(
|
self._common_policy_check(
|
||||||
'host:get_all', self.get_json, '/hosts/',
|
'host:get_all', self.get_json, '/hosts/',
|
||||||
expect_errors=True, extra_environ=extra_environ, headers=headers)
|
expect_errors=True, extra_environ=extra_environ, headers=headers)
|
||||||
|
|||||||
Reference in New Issue
Block a user