From 09b2dce4c33a08122ac22033206703d85d74b1c7 Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Sat, 18 Jul 2020 13:47:55 -0500 Subject: [PATCH] Introduce scope_types in FIP policy Appropriate scope_type for nova case: - https://specs.openstack.org/openstack/nova-specs/specs/ussuri/approved/policy-defaults-refresh.html#scope This commit introduce scope_type for FIP policies as 'system' and 'project' Partial implement blueprint policy-defaults-refresh-deprecated-apis Change-Id: I1dc11c4857466a6edb7baa9ccee3dde97a54afa0 --- nova/policies/floating_ips.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nova/policies/floating_ips.py b/nova/policies/floating_ips.py index f652f444386c..f046dfa7cb40 100644 --- a/nova/policies/floating_ips.py +++ b/nova/policies/floating_ips.py @@ -23,10 +23,11 @@ BASE_POLICY_NAME = 'os_compute_api:os-floating-ips' floating_ips_policies = [ policy.DocumentedRuleDefault( - BASE_POLICY_NAME, - base.RULE_ADMIN_OR_OWNER, - "Manage a project's floating IPs. These APIs are all deprecated.", - [ + name=BASE_POLICY_NAME, + check_str=base.RULE_ADMIN_OR_OWNER, + description="Manage a project's floating IPs. " + "These APIs are all deprecated.", + operations=[ { 'method': 'POST', 'path': '/servers/{server_id}/action (addFloatingIp)' @@ -51,7 +52,8 @@ floating_ips_policies = [ 'method': 'DELETE', 'path': '/os-floating-ips/{floating_ip_id}' }, - ]), + ], + scope_types=['system', 'project']), ]