From 70c5541da2a979a76521f23f05b2978359c214df Mon Sep 17 00:00:00 2001 From: 119Vik Date: Thu, 26 Sep 2013 06:23:17 -0400 Subject: [PATCH] Fixed policy check for manila api. Change-Id: I92e19cbfc1af5e7849151425fc12aa96479de7d3 --- manila/share/api.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/manila/share/api.py b/manila/share/api.py index aa1d7d2d51..e603f9ab84 100644 --- a/manila/share/api.py +++ b/manila/share/api.py @@ -64,7 +64,7 @@ def check_policy(context, action, target_obj=None): 'project_id': context.project_id, 'user_id': context.user_id, } - target.update(target_obj if isinstance(target_obj, dict) else {}) + target.update(target_obj or {}) _action = 'share:%s' % action manila.policy.enforce(context, _action, target) @@ -77,11 +77,10 @@ class API(base.Base): self.share_rpcapi = share_rpcapi.ShareAPI() super(API, self).__init__(db_driver) - @wrap_check_policy def create(self, context, share_proto, size, name, description, snapshot=None, availability_zone=None): """Create new share.""" - + check_policy(context, 'create') if snapshot is not None: if snapshot['status'] != 'available': msg = _('status must be available')