From 472be5cb143af9c62c5b678e96ff5a8820f23438 Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Mon, 16 Sep 2019 17:33:03 +0200 Subject: [PATCH] Add policy config for get_flavor_service_profile operation Policy for this API call was commented out but it is needed for DELETE flavor_service_profile operation as Neutron's policy module looks for ability for SHOW command when DELETE is rejected to ensure what error message should be returned to the user. This patch will fix Patrole test failure, see related bug description for details. Change-Id: I4a0e97845a40888f7f2c7267d9adb7be663ee380 Closes-Bug: #1843290 (cherry picked from commit ac0a426017e92d5d73e97c26ef18a888e02da104) --- neutron/conf/policies/flavor.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/neutron/conf/policies/flavor.py b/neutron/conf/policies/flavor.py index 91068cbcf5d..18499ee3348 100644 --- a/neutron/conf/policies/flavor.py +++ b/neutron/conf/policies/flavor.py @@ -122,6 +122,14 @@ rules = [ ] ), + policy.RuleDefault( + 'get_flavor_service_profile', + base.RULE_ANY, + ('Get a flavor associated with a given service profiles. ' + 'There is no corresponding GET operations in API currently. ' + 'This rule is currently referred only in the DELETE ' + 'of flavor_service_profile.') + ), policy.DocumentedRuleDefault( 'create_flavor_service_profile', base.RULE_ADMIN_ONLY, @@ -144,15 +152,6 @@ rules = [ }, ] ), - # TODO(amotoki): GET /flavors/{flavor_id}/service_profiles/{profile_id} - # does not work and leads to an internal server error. - # It is not defined in the API reference either. - # It needs investigation and temporarily commented out. - # policy.RuleDefault( - # 'get_flavor_service_profile', - # base.RULE_ANY, - # 'Get a flavor associate with a given service profiles', - # ), ]