Skip to content

Conversation

bbezak
Copy link
Member

@bbezak bbezak commented Oct 10, 2025

on some environment gateway chassis is delimited with "-" instead of "_" (maybe from older ovn?) - take into account both options:

`
(ovn-nb-db)[root@controller42 /]# ovn-nbctl --no-leader-only lrp-get-gateway-chassis lrp-c8821294-a9e7-4b95-a7fc-5ed2bb947ab2
lrp-c8821294-a9e7-4b95-a7fc-5ed2bb947ab2-node2 3
lrp-c8821294-a9e7-4b95-a7fc-5ed2bb947ab2-node0 2
lrp-c8821294-a9e7-4b95-a7fc-5ed2bb947ab2-node1 1

(ovn-nb-db)[root@controller42 /]# ovn-nbctl --no-leader-only lrp-get-gateway-chassis lrp-fb5d5639-f1e9-4ae7-8cdf-e9fa0c587826
lrp-fb5d5639-f1e9-4ae7-8cdf-e9fa0c587826_node0 3
lrp-fb5d5639-f1e9-4ae7-8cdf-e9fa0c587826_node1 2
lrp-fb5d5639-f1e9-4ae7-8cdf-e9fa0c587826_node2 1
`

Signed-off-by: Bartosz Bezak <bartosz@stackhpc.com>
@bbezak bbezak requested a review from a team as a code owner October 10, 2025 13:32
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 fixes an issue in an Ansible playbook's shell script where gateway chassis prefixes were not being stripped correctly when using a '-' delimiter. The change to use sed correctly addresses this. I have provided one suggestion to further improve the implementation by refactoring the loop to use shell parameter expansion. This would make the script more robust against potential special characters in variable names and more efficient by avoiding the creation of multiple subprocesses in a loop.

@bbezak
Copy link
Member Author

bbezak commented Oct 10, 2025

thx @grzegorzkoper for testing and finding bug

@bbezak bbezak merged commit e46c18c into stackhpc/2025.1 Oct 10, 2025
21 of 22 checks passed
@bbezak bbezak deleted the ovn-chassis-playbook-small-fixesTM branch October 10, 2025 14:48
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.

2 participants