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
diff --git a/barbican_tempest_plugin/tests/api/test_quotas.py b/barbican_tempest_plugin/tests/api/test_quotas.py
index 2546249..736001b 100644
--- a/barbican_tempest_plugin/tests/api/test_quotas.py
+++ b/barbican_tempest_plugin/tests/api/test_quotas.py
@@ -55,7 +55,7 @@
# 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 @@
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 @@
# 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 @@
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)
diff --git a/barbican_tempest_plugin/tests/rbac/v1/test_quotas.py b/barbican_tempest_plugin/tests/rbac/v1/test_quotas.py
index 16edc18..565faad 100644
--- a/barbican_tempest_plugin/tests/rbac/v1/test_quotas.py
+++ b/barbican_tempest_plugin/tests/rbac/v1/test_quotas.py
@@ -125,14 +125,14 @@
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 @@
)
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 @@
)
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,