Replace deprecated tenant_id property
The tenant_id property of RestClient in tempest was deprecated in 25.0.0. This replaces the deprecated property by the new project_id property to avoid the following warning. WARNING tempest.lib.common.rest_client [-] Deprecated: "tenant_id" property is deprecated for removal, use "project_id" instead Depends-on: https://review.opendev.org/c/openstack/tempest/+/707938 Change-Id: I1b690898f1c88244b9f9a68e67e2263058171c2f
This commit is contained in:
parent
30e50ef9c8
commit
00bd391ace
@ -55,7 +55,7 @@ class ProjectQuotasTest(base.BaseKeyManagerTest):
|
||||
|
||||
# Create a quota set for the test project
|
||||
self.create_project_quota(
|
||||
self.quota_client.tenant_id,
|
||||
self.quota_client.project_id,
|
||||
project_quotas={
|
||||
'secrets': 30,
|
||||
'orders': 10,
|
||||
@ -69,7 +69,7 @@ class ProjectQuotasTest(base.BaseKeyManagerTest):
|
||||
self.assertEqual(1, len(body.get('project_quotas')), body)
|
||||
project_quotas = body.get('project_quotas')[0]
|
||||
self.assertEqual(
|
||||
self.quota_client.tenant_id,
|
||||
self.quota_client.project_id,
|
||||
project_quotas.get('project_id'),
|
||||
body
|
||||
)
|
||||
@ -80,7 +80,7 @@ class ProjectQuotasTest(base.BaseKeyManagerTest):
|
||||
|
||||
# Verify that the quotas can be found via specific listing.
|
||||
body = self.quota_client.get_project_quota(
|
||||
self.quota_client.tenant_id
|
||||
self.quota_client.project_id
|
||||
)
|
||||
project_quotas = body.get('project_quotas')
|
||||
self.assertEqual(30, project_quotas.get('secrets'), body)
|
||||
@ -88,7 +88,7 @@ class ProjectQuotasTest(base.BaseKeyManagerTest):
|
||||
self.assertEqual(20, project_quotas.get('containers'), body)
|
||||
|
||||
# Delete the project quota and confirm that it got deleted
|
||||
self.delete_project_quota(self.quota_client.tenant_id)
|
||||
self.delete_project_quota(self.quota_client.project_id)
|
||||
|
||||
body = self.quota_client.list_quotas()
|
||||
self.assertEqual(0, body.get('total'), body)
|
||||
|
@ -125,14 +125,14 @@ class ProjectReaderTests(base.BarbicanV1RbacBase, BarbicanV1RbacQuota):
|
||||
self.assertRaises(exceptions.Forbidden, self.client.list_quotas)
|
||||
|
||||
def test_get_custom_quota_for_project(self):
|
||||
project_id = self.client.tenant_id
|
||||
project_id = self.client.project_id
|
||||
self.assertRaises(
|
||||
exceptions.Forbidden,
|
||||
self.client.get_project_quota,
|
||||
project_id)
|
||||
|
||||
def test_set_new_quota_for_project(self):
|
||||
project_id = self.client.tenant_id
|
||||
project_id = self.client.project_id
|
||||
self.assertRaises(
|
||||
exceptions.Forbidden,
|
||||
self.client.create_project_quota,
|
||||
@ -145,21 +145,21 @@ class ProjectReaderTests(base.BarbicanV1RbacBase, BarbicanV1RbacQuota):
|
||||
)
|
||||
|
||||
def test_remove_custom_quota_for_project(self):
|
||||
project_id = self.client.tenant_id
|
||||
project_id = self.client.project_id
|
||||
self.assertRaises(
|
||||
exceptions.Forbidden,
|
||||
self.client.delete_project_quota,
|
||||
project_id)
|
||||
|
||||
def test_get_custom_quota_for_other_project(self):
|
||||
project_id = self.other_secret_client.tenant_id
|
||||
project_id = self.other_secret_client.project_id
|
||||
self.assertRaises(
|
||||
exceptions.Forbidden,
|
||||
self.client.get_project_quota,
|
||||
project_id)
|
||||
|
||||
def test_set_new_quota_for_other_project(self):
|
||||
project_id = self.other_secret_client.tenant_id
|
||||
project_id = self.other_secret_client.project_id
|
||||
self.assertRaises(
|
||||
exceptions.Forbidden,
|
||||
self.client.create_project_quota,
|
||||
@ -172,7 +172,7 @@ class ProjectReaderTests(base.BarbicanV1RbacBase, BarbicanV1RbacQuota):
|
||||
)
|
||||
|
||||
def test_remove_custom_quota_for_other_project(self):
|
||||
project_id = self.other_secret_client.tenant_id
|
||||
project_id = self.other_secret_client.project_id
|
||||
self.assertRaises(
|
||||
exceptions.Forbidden,
|
||||
self.client.delete_project_quota,
|
||||
|
Loading…
x
Reference in New Issue
Block a user