Merge "Return both project_id when validating auto allocate network"

This commit is contained in:
Zuul 2024-05-24 09:31:16 +00:00 committed by Gerrit Code Review
commit 06c1972a48
2 changed files with 7 additions and 2 deletions

View File

@ -194,7 +194,9 @@ class AutoAllocatedTopologyMixin(object):
except n_exc.NotFound:
raise exceptions.AutoAllocationFailure(
reason=_("No default subnetpools defined"))
return {'id': 'dry-run=pass', 'tenant_id': tenant_id}
return {'id': 'dry-run=pass',
'tenant_id': tenant_id,
'project_id': tenant_id}
def _validate(self, context, tenant_id):
"""Validate and return the tenant to be associated to the topology."""

View File

@ -351,7 +351,10 @@ class AutoAllocateTestCase(testlib_api.SqlTestCase):
mock.patch.object(
self.mixin, '_get_supported_subnetpools'):
result = self.mixin._check_requirements(self.ctx, 'foo_tenant')
expected = {'id': 'dry-run=pass', 'tenant_id': 'foo_tenant'}
expected = {
'id': 'dry-run=pass',
'tenant_id': 'foo_tenant',
'project_id': 'foo_tenant'}
self.assertEqual(expected, result)
def test__cleanup_handles_failures(self):