Skip to content

Commit

Permalink
Merge "Remove the sample policy file"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Oct 10, 2016
2 parents 0b59a2d + d17a20d commit 6b62b0f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
4 changes: 4 additions & 0 deletions etc/nova/README-policy.json.txt
@@ -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
2 changes: 0 additions & 2 deletions etc/nova/policy.json

This file was deleted.

13 changes: 0 additions & 13 deletions nova/tests/unit/test_policy.py
Expand Up @@ -537,19 +537,6 @@ def test_admin_or_owner_rules(self):
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)
Expand Down

0 comments on commit 6b62b0f

Please sign in to comment.