Replace the deprecated argument tenant
The deprecated argument tenant from RequestContext has been removed since [1], so we switch to 'project_id'. [1] https://review.opendev.org/c/openstack/oslo.context/+/815938 Change-Id: I4e3e4c50ba5d829ed739e278b5286f2bf4808870
This commit is contained in:
parent
3e0fad7783
commit
a160e5c8dc
@ -182,18 +182,18 @@ class TestUtils(base.TestCase):
|
||||
|
||||
def test_oslo_context_to_keystone_token(self):
|
||||
auth_token_value = '16bd612f28ec479b8ffe8e124fc37b43'
|
||||
tenant_value = '00c6ef5ad2984af2acd7d42c299935c0'
|
||||
project_id_value = '00c6ef5ad2984af2acd7d42c299935c0'
|
||||
|
||||
ctxt = context.RequestContext(
|
||||
auth_token=auth_token_value,
|
||||
tenant=tenant_value)
|
||||
project_id=project_id_value)
|
||||
|
||||
ks_token_context = utils.credential_factory(context=ctxt)
|
||||
ks_token_context_class = ks_token_context.__class__.__name__
|
||||
|
||||
self.assertEqual('KeystoneToken', ks_token_context_class)
|
||||
self.assertEqual(auth_token_value, ks_token_context.token)
|
||||
self.assertEqual(tenant_value, ks_token_context.project_id)
|
||||
self.assertEqual(project_id_value, ks_token_context.project_id)
|
||||
|
||||
def test_invalid_auth_type(self):
|
||||
self.config_fixture.config(
|
||||
|
@ -107,7 +107,7 @@ that is being abstracted.
|
||||
sess = session.Session()
|
||||
|
||||
ctxt = context.RequestContext(auth_token=auth.get_token(sess),
|
||||
tenant=auth.get_project_id(sess))
|
||||
project_id=auth.get_project_id(sess))
|
||||
|
||||
ctxt can then be passed into any key_manager api call.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user