From 72028ff8b9aaac5dcabbca9e2897f45ce0d94b62 Mon Sep 17 00:00:00 2001 From: Takashi NATSUME Date: Tue, 29 Jan 2019 17:57:10 +0900 Subject: [PATCH] Fix a missing policy in test policy data Add the 'os_compute_api:os-flavor-manage:update' in the test policy data in nova/tests/unit/fake_policy.py. It should have been added in Ib16b0de82f9f9492f5cacf646dc3165a0849d75e. TrivialFix Change-Id: Ibbdcec1c9c5b897eb6dab993ece0535f307025ab --- nova/tests/unit/api/openstack/compute/test_flavor_manage.py | 5 +++-- nova/tests/unit/fake_policy.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nova/tests/unit/api/openstack/compute/test_flavor_manage.py b/nova/tests/unit/api/openstack/compute/test_flavor_manage.py index 17119675fc..2b333f5174 100644 --- a/nova/tests/unit/api/openstack/compute/test_flavor_manage.py +++ b/nova/tests/unit/api/openstack/compute/test_flavor_manage.py @@ -526,9 +526,10 @@ class FlavorManagerPolicyEnforcementV21(test.TestCase): exc.format_message()) def test_flavor_update_non_admin_fails(self): - """Tests that trying to update a flavor as a non-admin fails due - to the default policy. + """Tests that trying to update a flavor as a non-admin fails. """ + rule_name = "os_compute_api:os-flavor-manage:update" + self.policy.set_rules({rule_name: "is_admin:True"}) self.req.api_version_request = api_version_request.APIVersionRequest( '2.55') exc = self.assertRaises( diff --git a/nova/tests/unit/fake_policy.py b/nova/tests/unit/fake_policy.py index 37856a59d5..481119aae6 100644 --- a/nova/tests/unit/fake_policy.py +++ b/nova/tests/unit/fake_policy.py @@ -45,6 +45,7 @@ policy_data = """ "os_compute_api:os-flavor-extra-specs:index": "", "os_compute_api:os-flavor-extra-specs:show": "", "os_compute_api:os-flavor-manage:create": "", + "os_compute_api:os-flavor-manage:update": "", "os_compute_api:os-flavor-manage:delete": "", "os_compute_api:os-floating-ip-pools": "", "os_compute_api:os-floating-ips": "",