Fix context deprecation warnings
DeprecationWarning: Property 'tenant' has moved to 'project_id' Trivialfix Change-Id: Ia34e62b1646441c88be1c98cdf1c333236f824ba
This commit is contained in:
parent
328df6a5cc
commit
1b664be5c7
|
@ -6676,7 +6676,7 @@ class DbOperationBoundMixin(object):
|
||||||
|
|
||||||
def get_api_kwargs(self):
|
def get_api_kwargs(self):
|
||||||
context_ = self._get_context()
|
context_ = self._get_context()
|
||||||
return {'set_context': True, 'tenant_id': context_.tenant}
|
return {'set_context': True, 'tenant_id': context_.project_id}
|
||||||
|
|
||||||
def _list_and_record_queries(self, resource, query_params=None):
|
def _list_and_record_queries(self, resource, query_params=None):
|
||||||
kwargs = {'neutron_context': self._get_context()}
|
kwargs = {'neutron_context': self._get_context()}
|
||||||
|
|
|
@ -677,7 +677,7 @@ class TestMl2DbOperationBoundsTenantRbac(TestMl2DbOperationBoundsTenant):
|
||||||
net = self.driver.create_network(
|
net = self.driver.create_network(
|
||||||
context.get_admin_context(),
|
context.get_admin_context(),
|
||||||
{'network': {'name': 'net1',
|
{'network': {'name': 'net1',
|
||||||
'tenant_id': context_.tenant,
|
'tenant_id': context_.project_id,
|
||||||
'admin_state_up': True,
|
'admin_state_up': True,
|
||||||
'shared': True}})
|
'shared': True}})
|
||||||
# create port that belongs to another tenant
|
# create port that belongs to another tenant
|
||||||
|
|
|
@ -53,7 +53,7 @@ class NeutronKeystoneContextTestCase(base.BaseTestCase):
|
||||||
response = self.request.get_response(self.middleware)
|
response = self.request.get_response(self.middleware)
|
||||||
self.assertEqual('200 OK', response.status)
|
self.assertEqual('200 OK', response.status)
|
||||||
self.assertEqual('testtenantid', self.context.tenant_id)
|
self.assertEqual('testtenantid', self.context.tenant_id)
|
||||||
self.assertEqual('testtenantid', self.context.tenant)
|
self.assertEqual('testtenantid', self.context.project_id)
|
||||||
|
|
||||||
def test_roles_no_admin(self):
|
def test_roles_no_admin(self):
|
||||||
self.request.headers['X_PROJECT_ID'] = 'testtenantid'
|
self.request.headers['X_PROJECT_ID'] = 'testtenantid'
|
||||||
|
|
Loading…
Reference in New Issue