Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rabbitmq_user: Handle non-zero exit codes (#56164) #57738

Open
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
4 participants
@plastikat
Copy link
Contributor

commented Jun 12, 2019

SUMMARY

Fixes #56164.

When provided with a wrong password rabbitmqctl authenticate_user returns a non-zero exit code (65). This seems to be unexpected by the module and it fails when update_password is set to 'always'.

To mitigate this behavior we augment the _exec method by adding a check_rc flag (which defaults to True, hence it's backward-compatible) and override it when we need it (in check_password method to address #56164).

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION

@plastikat plastikat force-pushed the plastikat:bugfix_rabbitmq_user_#56164 branch from fee96a9 to 36f6307 Jun 12, 2019

@plastikat plastikat marked this pull request as ready for review Jun 12, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2019

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/messaging/rabbitmq/rabbitmq_user.py:194:29: E127 continuation line over-indented for visual indent

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2019

rabbitmq_user: Handle non-zero exit codes (#56164)
When provided with a wrong password `rabbitmqctl
authenticate_user` returns a non-zero exit code
(65). This seems to be unexpected by the module and
it fails when `update_password` is set to 'always'.

To mitigate this behavior we augment the `_exec`
method by adding a `check_rc` flag (which defaults
to `True`, hence it's backward-compatible) and
override it when we need it (in `check_password`
method to address #56164).

@plastikat plastikat force-pushed the plastikat:bugfix_rabbitmq_user_#56164 branch from 36f6307 to 05d4f23 Jun 12, 2019

@resmo

resmo approved these changes Jun 13, 2019

Copy link
Member

left a comment

LGTM

@ansibot ansibot removed the needs_triage label Jun 13, 2019

@pilou-
Copy link
Contributor

left a comment

Existing rabbitmq_user integration tests could be updated.

@pilou-

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2019

I prefer this one rather than #57576 (using a parameter looks better than using an attribute).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.