summaryrefslogtreecommitdiff
path: root/nova/policies
diff options
context:
space:
mode:
authorGhanshyam Mann <gmann@ghanshyammann.com>2020-07-17 15:11:26 -0500
committerGhanshyam Mann <gmann@ghanshyammann.com>2020-07-17 15:22:09 -0500
commit672aa45dd1229c55d06d862d6b359eb3925308a4 (patch)
tree887eaf35ab63f40ce47fd0cea13e627c7c35f851 /nova/policies
parentbf9762f701555d1bbc1ae3d5e9d8854f4ece395b (diff)
downloadnova-672aa45dd1229c55d06d862d6b359eb3925308a4.tar.gz
Introduce scope_types in baremetal node
Appropriate scope_type for nova case: - https://specs.openstack.org/openstack/nova-specs/specs/ussuri/approved/policy-defaults-refresh.html#scope This commit introduce scope_type for baremetal nodes policies as 'system'. Also adds the test case with scope_type enabled and verify we pass and fail the policy check with expected context. Partial implement blueprint policy-defaults-refresh-deprecated-apis Change-Id: Ieed4e23c4296fe8a338910a235348574327decb3
Diffstat (limited to 'nova/policies')
-rw-r--r--nova/policies/baremetal_nodes.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/nova/policies/baremetal_nodes.py b/nova/policies/baremetal_nodes.py
index 6f52f44123..1fa68abcad 100644
--- a/nova/policies/baremetal_nodes.py
+++ b/nova/policies/baremetal_nodes.py
@@ -23,13 +23,13 @@ BASE_POLICY_NAME = 'os_compute_api:os-baremetal-nodes'
baremetal_nodes_policies = [
policy.DocumentedRuleDefault(
- BASE_POLICY_NAME,
- base.RULE_ADMIN_API,
- """List and show details of bare metal nodes.
+ name=BASE_POLICY_NAME,
+ check_str=base.RULE_ADMIN_API,
+ description="""List and show details of bare metal nodes.
These APIs are proxy calls to the Ironic service and are deprecated.
""",
- [
+ operations=[
{
'method': 'GET',
'path': '/os-baremetal-nodes'
@@ -38,7 +38,8 @@ These APIs are proxy calls to the Ironic service and are deprecated.
'method': 'GET',
'path': '/os-baremetal-nodes/{node_id}'
}
- ]),
+ ],
+ scope_types=['system']),
]