Merge "Remove the sample policy file"

This commit is contained in:
Jenkins 2016-10-10 12:18:21 +00:00 committed by Gerrit Code Review
commit 6b62b0f228
3 changed files with 4 additions and 15 deletions

View File

@ -0,0 +1,4 @@
To generate the sample policy.json file, run the following command from the top
level of the nova directory:
tox -egenpolicy

View File

@ -1,2 +0,0 @@
{
}

View File

@ -537,19 +537,6 @@ class RealRolePolicyTestCase(test.NoDBTestCase):
policy.authorize(self.non_admin_context, rule,
{'project_id': 'fake', 'user_id': 'fake'})
def test_no_empty_rules(self):
# Parsed rules substitute '@' for '', so we need to look at the raw
# policy definitions
# CONF.oslo_policy.policy_file has been set to the sample file by
# the RealPolicyFixture used in setUp
with open(CONF.oslo_policy.policy_file, 'r') as policy_file:
policy_dict = jsonutils.loads(policy_file.read())
for rule_name, rule in policy_dict.items():
self.assertNotEqual('', str(rule),
'%s should not be empty, use "@" instead if the policy '
'should allow everything' % rule_name)
def test_allow_all_rules(self):
for rule in self.allow_all_rules:
policy.authorize(self.non_admin_context, rule, self.target)