diff --git a/etc/nova/README-policy.json.txt b/etc/nova/README-policy.json.txt new file mode 100644 index 000000000000..23b64bea9536 --- /dev/null +++ b/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 diff --git a/etc/nova/policy.json b/etc/nova/policy.json deleted file mode 100644 index 2c63c0851048..000000000000 --- a/etc/nova/policy.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} diff --git a/nova/tests/unit/test_policy.py b/nova/tests/unit/test_policy.py index 0238ac584938..22eb66c57f5b 100644 --- a/nova/tests/unit/test_policy.py +++ b/nova/tests/unit/test_policy.py @@ -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)