diff options
author | Michael Johnson <johnsomor@gmail.com> | 2023-04-17 23:21:05 +0000 |
---|---|---|
committer | Michael Johnson <johnsomor@gmail.com> | 2023-04-17 23:21:28 +0000 |
commit | 0f37baf808295699847ca9b897cd485bf1f5ea1a (patch) | |
tree | 3301c2f9dd6f24366cbdd7332f0cf03559566e95 | |
parent | ae3bb0ddf359cd0a0d7b5b4705e331d104c6fce0 (diff) | |
download | designate-0f37baf808295699847ca9b897cd485bf1f5ea1a.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 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.') |