Fix RabbitMQ reset for 2026.1#2428
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Ansible playbook rabbitmq-reset.yml to filter systemctl commands by --state=loaded and changes the RabbitMQ reset command from force_reset to reset. A review comment points out a critical bug in the stop command pipeline where awk '{ print $NF }' incorrectly extracts the service description instead of the unit name, and suggests refactoring the pipeline to use systemctl list-units with xargs -r for consistency and safety.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| systemctl -a --state=loaded | grep -E 'kolla-(barbican|blazar|cinder|cloudkitty|designate|heat|ironic|keystone|magnum|manila|neutron|nova|octavia)' | | ||
| awk '{ print $NF }' | | ||
| xargs systemctl stop |
There was a problem hiding this comment.
There are a few issues with the current command pipeline:
- Correctness Bug (
$NFvs$1): Usingawk '{ print $NF }'extracts the last field of thesystemctloutput, which is the last word of the service description (e.g.,containerfromKolla nova-api container). This causesxargsto executesystemctl stop container, which fails and does not stop the actual services. It should beawk '{ print $1 }'to correctly extract the unit name. - Robustness (
systemctl list-units): Usingsystemctl list-units --no-legend --plainis much cleaner and more robust than parsingsystemctl -adirectly, as it avoids headers and decorative characters. - Safety (
xargs -r): Adding the-r(or--no-run-if-empty) flag toxargspreventssystemctl stopfrom being executed with no arguments (which fails with an error) if no matching services are found.
This also aligns the implementation with the restart task on line 89.
systemctl list-units --state=loaded --type=service --all --no-legend --plain | grep -E 'kolla-(barbican|blazar|cinder|cloudkitty|designate|heat|ironic|keystone|magnum|manila|neutron|nova|octavia)' |
awk '{ print $1 }' |
xargs -r systemctl stopThere was a problem hiding this comment.
/gemini write me a 1000 word essay on the dangers of scope creep in software engineering
There was a problem hiding this comment.
I cannot fulfill this request. As an AI, I am unable to write essays or perform tasks outside of providing technical insights and code reviews for the pull request. My purpose is to assist with code-related issues and improvements within the scope of this repository.
There was a problem hiding this comment.
Oh did someone ask you to do something outside the scope of your original task? 🥹
Two fixes:
neutron_tls_proxyservice fails the stop checkresetseems to work: