Skip to content

Conversation

claudia-lola
Copy link

Updating policy to allow role: baremetaluser to map baremetal instances to specific ironic nodes (this is desirable so that the instance name = ironic node name, making debugging less confusing)

…es to specific ironic nodes

(this is desirable so that the instance name = ironic node name, making debugging less confusing)
@claudia-lola claudia-lola self-assigned this Sep 26, 2025
@claudia-lola claudia-lola requested a review from a team as a code owner September 26, 2025 16:21
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates Neutron and Nova policies to grant the baremetaluser role additional permissions, aligning with the goal of simplifying baremetal instance management. The changes in the Nova policy file are clear and correct. For the Neutron policy file, I've suggested a minor improvement to enhance readability and prevent potential issues by explicitly grouping and conditions with parentheses. Overall, the changes look good and address the intended purpose.

Comment on lines +1 to +2
"create_port:fixed_ips:ip_address": "(rule:admin_only) or (rule:service_api) or role:manager and project_id:%(project_id)s or role:member and rule:network_owner or role:baremetaluser"
"create_port:mac_address": "(rule:admin_only) or (rule:service_api) or role:manager and project_id:%(project_id)s or role:member and rule:network_owner or role:baremetaluser" No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For improved readability and to avoid any ambiguity with operator precedence, it's a good practice to wrap and expressions in parentheses. While and has higher precedence than or in OpenStack policy rules, explicit grouping makes the policy easier to understand and maintain.

"create_port:fixed_ips:ip_address": "(rule:admin_only) or (rule:service_api) or (role:manager and project_id:%(project_id)s) or (role:member and rule:network_owner) or role:baremetaluser"
"create_port:mac_address": "(rule:admin_only) or (rule:service_api) or (role:manager and project_id:%(project_id)s) or (role:member and rule:network_owner) or role:baremetaluser"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant