Merge "Fix 'Inheritance-based rule deprecated' log warning"

This commit is contained in:
Jenkins 2013-05-30 16:52:38 +00:00 committed by Gerrit Code Review
commit fe440369d8
3 changed files with 4 additions and 4 deletions

View File

@ -58,7 +58,7 @@ def init():
def _set_brain(data):
default_rule = FLAGS.policy_default_rule
policy.set_brain(policy.HttpBrain.load_json(data, default_rule))
policy.set_brain(policy.Brain.load_json(data, default_rule))
def enforce(context, action, target):

View File

@ -82,7 +82,7 @@ class PolicyTestCase(test.TestCase):
"example:uppercase_admin": [["role:ADMIN"], ["role:sysadmin"]],
}
# NOTE(vish): then overload underlying brain
common_policy.set_brain(common_policy.HttpBrain(rules))
common_policy.set_brain(common_policy.Brain(rules))
self.context = context.RequestContext('fake', 'fake', roles=['member'])
self.target = {}
@ -170,7 +170,7 @@ class DefaultPolicyTestCase(test.TestCase):
self.context = context.RequestContext('fake', 'fake')
def _set_brain(self, default_rule):
brain = cinder.openstack.common.policy.HttpBrain(self.rules,
brain = cinder.openstack.common.policy.Brain(self.rules,
default_rule)
cinder.openstack.common.policy.set_brain(brain)

View File

@ -1307,7 +1307,7 @@ class VolumePolicyTestCase(test.TestCase):
cinder.policy.reset()
def _set_rules(self, rules):
cinder.common.policy.set_brain(cinder.common.policy.HttpBrain(rules))
cinder.common.policy.set_brain(cinder.common.policy.Brain(rules))
def test_check_policy(self):
self.mox.StubOutWithMock(cinder.policy, 'enforce')