From 297bedbfde0a99de4ab3e7cc6b4c65bb1d34d1d0 Mon Sep 17 00:00:00 2001 From: Takashi NATSUME Date: Tue, 29 Jan 2019 15:40:14 +0900 Subject: [PATCH] Remove deprecated 'flavors' policy The 'os_compute_api:flavors' policy has been deprecated since 16.0.0 Pike. Remove the 'os_compute_api:flavors' policy. Change-Id: I771b6f641d25d6b27076cf36dd8552df50b7ccd3 --- nova/policies/__init__.py | 2 -- nova/policies/flavors.py | 35 ------------------- nova/tests/unit/test_policy.py | 1 - ...cated-flavors-policy-c03c5d227a7b0c87.yaml | 4 +++ 4 files changed, 4 insertions(+), 38 deletions(-) delete mode 100644 nova/policies/flavors.py create mode 100644 releasenotes/notes/remove-deprecated-flavors-policy-c03c5d227a7b0c87.yaml diff --git a/nova/policies/__init__.py b/nova/policies/__init__.py index 2abae79a6fb8..c837df848c3f 100644 --- a/nova/policies/__init__.py +++ b/nova/policies/__init__.py @@ -35,7 +35,6 @@ from nova.policies import extensions from nova.policies import flavor_access from nova.policies import flavor_extra_specs from nova.policies import flavor_manage -from nova.policies import flavors from nova.policies import floating_ip_pools from nova.policies import floating_ips from nova.policies import hosts @@ -100,7 +99,6 @@ def list_rules(): flavor_access.list_rules(), flavor_extra_specs.list_rules(), flavor_manage.list_rules(), - flavors.list_rules(), floating_ip_pools.list_rules(), floating_ips.list_rules(), hosts.list_rules(), diff --git a/nova/policies/flavors.py b/nova/policies/flavors.py deleted file mode 100644 index 11fd4b7a1df7..000000000000 --- a/nova/policies/flavors.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2016 Cloudbase Solutions Srl -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from oslo_policy import policy - -from nova.policies import base - - -BASE_POLICY_NAME = 'os_compute_api:flavors' - - -flavors_policies = [ - # TODO(johngarbutt) this doesn't appear to be used in the code and - # as such should be removed. - policy.RuleDefault( - name=BASE_POLICY_NAME, - check_str=base.RULE_ADMIN_OR_OWNER, - description='Deprecated in Pike and will be removed in next release'), -] - - -def list_rules(): - return flavors_policies diff --git a/nova/tests/unit/test_policy.py b/nova/tests/unit/test_policy.py index 1d804dd321b7..a246deda5b17 100644 --- a/nova/tests/unit/test_policy.py +++ b/nova/tests/unit/test_policy.py @@ -399,7 +399,6 @@ class RealRolePolicyTestCase(test.NoDBTestCase): "os_compute_api:os-remote-consoles", "os_compute_api:os-deferred-delete", "os_compute_api:os-flavor-access", -"os_compute_api:flavors", "os_compute_api:os-flavor-extra-specs:index", "os_compute_api:os-flavor-extra-specs:show", "os_compute_api:os-floating-ip-pools", diff --git a/releasenotes/notes/remove-deprecated-flavors-policy-c03c5d227a7b0c87.yaml b/releasenotes/notes/remove-deprecated-flavors-policy-c03c5d227a7b0c87.yaml new file mode 100644 index 000000000000..7afb350d8f4a --- /dev/null +++ b/releasenotes/notes/remove-deprecated-flavors-policy-c03c5d227a7b0c87.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - The ``os_compute_api:flavors`` policy deprecated in 16.0.0 + has been removed.