From 0f37baf808295699847ca9b897cd485bf1f5ea1a Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Mon, 17 Apr 2023 23:21:05 +0000 Subject: Fix shared zones missing project ID error Previously if you tried to create a zone share with a scoped token that does not have a project ID, you would receive a 500 error. This patch corrects that to return a proper error describing that a project ID is required when creating zone shares. Change-Id: Ibeb7154a4c300f59dfa25737736f59609b938bcc --- designate/central/service.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designate/central/service.py b/designate/central/service.py index 77334dd0..e9831e80 100644 --- a/designate/central/service.py +++ b/designate/central/service.py @@ -1211,6 +1211,8 @@ class Service(service.RPCService): policy.check('share_zone', context, target) + self._is_valid_project_id(context.project_id) + if zone.tenant_id == shared_zone.target_project_id: raise exceptions.BadRequest( 'Cannot share the zone with the zone owner.') -- cgit v1.2.1