Rename the deprecated argument tenant with project
Since oslo.context=4.0.0 Feb 3, 2022 the deprecated argument
tenant was removed [1]
- Remove temporarily monasca-tempest-log-python3-influxdb check
- Remove permanently monasca-tempest-python3-cassandra check
[1] f4cbe4c296
Change-Id: I38dc75df3e7a7575be37dbfa3714e694a19f35c4
This commit is contained in:
parent
8a1102e58b
commit
18ba158e5a
|
@ -205,15 +205,12 @@
|
|||
- release-notes-jobs-python3
|
||||
check:
|
||||
jobs:
|
||||
- monasca-tempest-log-python3-influxdb
|
||||
- monasca-tempest-python3-influxdb
|
||||
- monasca-tempest-python3-cassandra
|
||||
- build-monasca-docker-image
|
||||
gate:
|
||||
queue: monasca
|
||||
jobs:
|
||||
- monasca-tempest-python3-influxdb
|
||||
- monasca-tempest-log-python3-influxdb
|
||||
post:
|
||||
jobs:
|
||||
- publish-monasca-api-docker-image
|
||||
|
|
|
@ -24,8 +24,8 @@ from monasca_api.v2.common import exceptions
|
|||
|
||||
policy.POLICIES = policies
|
||||
|
||||
_TENANT_ID_PARAM = 'tenant_id'
|
||||
"""Name of the query-param pointing at project-id (tenant-id)"""
|
||||
_PROJECT_ID_PARAM = 'project_id'
|
||||
"""Name of the query-param pointing at project-id"""
|
||||
|
||||
|
||||
class Request(falcon.Request):
|
||||
|
@ -42,17 +42,17 @@ class Request(falcon.Request):
|
|||
|
||||
@property
|
||||
def project_id(self):
|
||||
"""Returns project-id (tenant-id)
|
||||
"""Returns project-id
|
||||
|
||||
:return: project-id
|
||||
:rtype: str
|
||||
|
||||
"""
|
||||
return self.context.tenant
|
||||
return self.context.project_id
|
||||
|
||||
@property
|
||||
def cross_project_id(self):
|
||||
"""Returns project-id (tenant-id) found in query params.
|
||||
"""Returns project-id found in query params.
|
||||
|
||||
This particular project-id is later on identified as
|
||||
cross-project-id
|
||||
|
@ -61,7 +61,7 @@ class Request(falcon.Request):
|
|||
:rtype: str
|
||||
|
||||
"""
|
||||
return self.get_param(_TENANT_ID_PARAM, required=False)
|
||||
return self.get_param(_PROJECT_ID_PARAM, required=False)
|
||||
|
||||
@property
|
||||
def user_id(self):
|
||||
|
|
|
@ -25,7 +25,7 @@ rules = [
|
|||
name='api:delegate',
|
||||
check_str=DELEGATE_AUTHORIZED_ROLES,
|
||||
description='The rules which allow to access the API on'
|
||||
' behalf of another tenant.',
|
||||
' behalf of another project (tenant).',
|
||||
|
||||
)
|
||||
]
|
||||
|
|
|
@ -28,7 +28,7 @@ class PolicyFileTestCase(base.BaseTestCase):
|
|||
def setUp(self):
|
||||
super(PolicyFileTestCase, self).setUp()
|
||||
self.context = context.RequestContext(user='fake',
|
||||
tenant='fake',
|
||||
project_id='fake',
|
||||
is_admin=False)
|
||||
self.target = {}
|
||||
|
||||
|
@ -83,7 +83,7 @@ class PolicyTestCase(base.BaseTestCase):
|
|||
policy_engine.init()
|
||||
|
||||
self.context = context.RequestContext(user='fake',
|
||||
tenant='fake',
|
||||
project_id='fake',
|
||||
is_admin=False)
|
||||
policy_engine._ENFORCER.register_defaults(rules)
|
||||
self.target = {}
|
||||
|
|
|
@ -81,7 +81,7 @@ class TestApiLogs(base.BaseApiTestCase):
|
|||
response = self.simulate_request(
|
||||
path='/logs',
|
||||
method='POST',
|
||||
query_string='tenant_id=1',
|
||||
query_string='project_id=1',
|
||||
headers={
|
||||
'X_ROLES': ROLES,
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -101,7 +101,7 @@ class TestApiLogs(base.BaseApiTestCase):
|
|||
response = self.simulate_request(
|
||||
path='/logs',
|
||||
method='POST',
|
||||
query_string='tenant_id=1',
|
||||
query_string='project_id=1',
|
||||
headers={
|
||||
'X-Roles': ROLES,
|
||||
'Content-Type': 'application/json',
|
||||
|
|
|
@ -27,9 +27,9 @@ class TestPolicyFileCase(base.BaseTestCase):
|
|||
def setUp(self):
|
||||
super(TestPolicyFileCase, self).setUp()
|
||||
self.context = context.RequestContext(user='fake',
|
||||
tenant='fake',
|
||||
project_id='fake',
|
||||
roles=['fake'])
|
||||
self.target = {'tenant_id': 'fake'}
|
||||
self.target = {'project_id': 'fake'}
|
||||
|
||||
def test_modified_policy_reloads(self):
|
||||
tmp_file = \
|
||||
|
|
|
@ -41,7 +41,7 @@ class TestRequest(base.BaseApiTestCase):
|
|||
'X_PROJECT_ID': '333',
|
||||
'X_ROLES': 'terminator,predator',
|
||||
},
|
||||
query_string='tenant_id=444'
|
||||
query_string='project_id=444'
|
||||
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue