From aac93592a986b33479a0208f65d900694f1b1316 Mon Sep 17 00:00:00 2001 From: Liyankun Date: Sat, 1 Aug 2015 17:40:24 +0800 Subject: [PATCH] Fix docstring for policy.enforce method This patch corrects the name of the 'target' parameter and adds the 'do_raise' parameter in the doc string for the policy.enforce method. TrivialFix Change-Id: Ib6000ae868bc91a1aa8504b377408a829f1c9951 --- manila/policy.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/manila/policy.py b/manila/policy.py index ba89d9b414..08add876de 100644 --- a/manila/policy.py +++ b/manila/policy.py @@ -51,12 +51,17 @@ def enforce(context, action, target, do_raise=True): i.e. ``compute:create_instance``, ``compute:attach_volume``, ``volume:attach_volume`` - - :param object: dictionary representing the object of the action + :param target: dictionary representing the object of the action for object creation this should be a dictionary representing the location of the object e.g. ``{'project_id': context.project_id}`` + :param do_raise: Whether to raise an exception if check fils. - :raises manila.exception.PolicyNotAuthorized: if verification fails. + :returns: When ``do_raise`` is ``False``, returns a value that + evaluates as ``True`` or ``False`` depending on whether + the policy allows action on the target. + + :raises: manila.exception.PolicyNotAuthorized if verification fails + and ``do_raise`` is ``True``. """ init()