diff options
author | Michael Johnson <johnsomor@gmail.com> | 2023-04-17 23:21:05 +0000 |
---|---|---|
committer | Michael Johnson <johnsomor@gmail.com> | 2023-04-19 17:01:18 +0000 |
commit | 9c0df1a80956ec9819728c136db32153f66414eb (patch) | |
tree | 329f3c303fe89a633f67d742f59ba1939d4ea0b2 | |
parent | 4c08082bea6793334d3a215cdc0c3f051cdf6785 (diff) | |
download | designate-9c0df1a80956ec9819728c136db32153f66414eb.tar.gz |
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
-rw-r--r-- | designate/central/service.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/designate/central/service.py b/designate/central/service.py index 1a87db73..7772a925 100644 --- a/designate/central/service.py +++ b/designate/central/service.py @@ -1209,6 +1209,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.') |