Browse Source

Fix context deprecation warnings

DeprecationWarning: Property 'tenant' has moved to 'project_id'

Trivialfix

Change-Id: Ia34e62b1646441c88be1c98cdf1c333236f824ba
changes/57/544057/1
Brian Haley 4 years ago
parent
commit
1b664be5c7
  1. 2
      neutron/tests/unit/db/test_db_base_plugin_v2.py
  2. 2
      neutron/tests/unit/plugins/ml2/test_plugin.py
  3. 2
      neutron/tests/unit/test_auth.py

2
neutron/tests/unit/db/test_db_base_plugin_v2.py

@ -6676,7 +6676,7 @@ class DbOperationBoundMixin(object):
def get_api_kwargs(self):
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):
kwargs = {'neutron_context': self._get_context()}

2
neutron/tests/unit/plugins/ml2/test_plugin.py

@ -677,7 +677,7 @@ class TestMl2DbOperationBoundsTenantRbac(TestMl2DbOperationBoundsTenant):
net = self.driver.create_network(
context.get_admin_context(),
{'network': {'name': 'net1',
'tenant_id': context_.tenant,
'tenant_id': context_.project_id,
'admin_state_up': True,
'shared': True}})
# create port that belongs to another tenant

2
neutron/tests/unit/test_auth.py

@ -53,7 +53,7 @@ class NeutronKeystoneContextTestCase(base.BaseTestCase):
response = self.request.get_response(self.middleware)
self.assertEqual('200 OK', response.status)
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):
self.request.headers['X_PROJECT_ID'] = 'testtenantid'

Loading…
Cancel
Save