diff options
author | Michael Johnson <johnsomor@gmail.com> | 2022-02-28 23:22:12 +0000 |
---|---|---|
committer | Michael Johnson <johnsomor@gmail.com> | 2022-03-01 00:05:48 +0000 |
commit | 8ce022a7b98521a1016e63350abff97aba9b9f77 (patch) | |
tree | 7c90df4d2dfd16facacc9e73e5ed7daae3e44c43 | |
parent | 694d189f36748dc235182f9922483e8ddd93271c (diff) | |
download | designate-8ce022a7b98521a1016e63350abff97aba9b9f77.tar.gz |
Fix Designate for use with oslo.context>=4.0.0
This patch updates Designate to be compatible with oslo.context>=4.0.0.
Oslo.context has removed support for "tenant" in the context.
Change-Id: I49ed7df40bdd2dfbdc4b21817b23e4e21c8ce400
-rw-r--r-- | designate/common/policies/base.py | 4 | ||||
-rw-r--r-- | designate/context.py | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/designate/common/policies/base.py b/designate/common/policies/base.py index c09298db..a0674674 100644 --- a/designate/common/policies/base.py +++ b/designate/common/policies/base.py @@ -77,7 +77,7 @@ RULE_ZONE_TRANSFER = ( RULE_ADMIN = 'rule:admin' RULE_ADMIN_OR_OWNER = 'rule:admin_or_owner' LEGACY_RULE_ZONE_TRANSFER = "rule:admin_or_owner OR " \ - "tenant:%(target_tenant_id)s " \ + "project_id:%(target_tenant_id)s " \ "OR None:%(target_tenant_id)s" deprecated_default = policy.DeprecatedRule( @@ -95,7 +95,7 @@ rules = [ # TODO(johnsom) remove when the deprecated RBAC rules are removed. policy.RuleDefault( name="owner", - check_str="tenant:%(tenant_id)s"), + check_str="project_id:%(tenant_id)s"), # TODO(johnsom) remove when the deprecated RBAC rules are removed. policy.RuleDefault( name="admin_or_owner", diff --git a/designate/context.py b/designate/context.py index 13e56697..01ea0ce8 100644 --- a/designate/context.py +++ b/designate/context.py @@ -76,7 +76,10 @@ class DesignateContext(context.RequestContext): user_idt = ( self.user_idt_format.format( user=user, + # TODO(johnsom) Remove tenant once oslo.context>=4.0.0 is + # the lower bound version. tenant=self.project_id or '-', + project_id=self.project_id or '-', domain=self.domain_id or '-', user_domain=self.user_domain_id or '-', p_domain=self.project_domain_id or '-') @@ -84,6 +87,9 @@ class DesignateContext(context.RequestContext): # Update the dict with Designate specific extensions and overrides d.update({ + # TODO(johnsom) Remove project_id once oslo.context>=4.0.0 is + # the lower bound version. + 'project_id': self.project_id, 'user_identity': user_idt, 'original_project_id': self.original_project_id, 'service_catalog': self.service_catalog, |