From 3052a451d1c33ba70cb2aab8ddb3ed9a94951fd2 Mon Sep 17 00:00:00 2001 From: He Jie Xu Date: Tue, 2 May 2017 11:41:15 +0800 Subject: [PATCH] Add more description to policies in the keypairs.py This updates the policy doc for server extend controller in keypairs.py Partial implement blueprint blueprint policy-docs Change-Id: I32d2dae19fc2cfa99470edbb39dafd56de279b73 --- nova/policies/keypairs.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/nova/policies/keypairs.py b/nova/policies/keypairs.py index 94797271483d..543625009337 100644 --- a/nova/policies/keypairs.py +++ b/nova/policies/keypairs.py @@ -13,8 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_policy import policy - from nova.policies import base @@ -63,9 +61,20 @@ keypairs_policies = [ 'method': 'GET' } ]), - policy.RuleDefault( - name=BASE_POLICY_NAME, - check_str=base.RULE_ADMIN_OR_OWNER), + base.create_rule_default( + BASE_POLICY_NAME, + base.RULE_ADMIN_OR_OWNER, + "Return 'key_name' in the response of server.", + [ + { + 'path': '/servers/{id}', + 'method': 'GET', + }, + { + 'path': '/servers/detail', + 'method': 'GET' + } + ]), ]