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

Fix no returning rabbitmq_version and add default version? #819

Closed
wants to merge 2 commits into from
Closed

Fix no returning rabbitmq_version and add default version? #819

wants to merge 2 commits into from

Conversation

justintime4tea
Copy link

@justintime4tea justintime4tea commented Dec 1, 2019

Signed-off-by: Justin Gross [email protected]

Pull Request (PR) description

I'm installing RabbitMQ 3.8.1 using rabbitmq module params as such:

management_enable          => true
package_name                    => rabbitmq-server-3.8.1
service_name                      => rabbitmq-server
use_config_file_for_plugins => true

I attempt to add user:

 rabbitmq_user { 'SOME_USER':
    password => 'SOME_PASS',
 }

A check is done to see what version rabbit is so to know which command line options to use when running the rabbitmq CLI (-q --no-table-headers, or just -q) to determine if the user already exists or not.

The self.rabbitmq_version function returns a version if @rabbitmq_version is declared.

When not declared however it apparently tries to declare it (not a ruby developer) but then afterwords never returns it so whomever has called it is receiving a NilClass? (at least the very first time? presumably, because it sets the @rabbitmq_server?)

The error produced is as such:
"Failed to apply catalog: undefined method `scan' for nil:NilClass" because rabbitmq_version never returns anything unless it is globally defined (@rabbitmq_version)

This error is referenced by this issue:
#817

This Pull Request (PR) fixes the following issues

@@ -40,6 +40,8 @@ def self.rabbitmq_version
output = rabbitmqctl('-q', 'status')
version = output.match(%r{RabbitMQ.*?([\d\.]+)})
@rabbitmq_version = version[1] if version
return version[1] if version
return '3.8.1'
Copy link
Contributor

Choose a reason for hiding this comment

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

The module’s default behavior is to install 3.6.x, IIRC. I’m not sure if line 43 is necessary, but pretty sure this is the wrong behavior.

Do you get this issue with the most recent release, or with git master?

@wyardley
Copy link
Contributor

wyardley commented Dec 2, 2019

Have you verified if #814 resolves this?

@wyardley wyardley mentioned this pull request Dec 2, 2019
@KZachariassen
Copy link

Have you verified if #814 resolves this?

I have just tested this on Ubuntu 18.04 with puppet 3.8.1 and it solved my problem.

@wyardley
Copy link
Contributor

I have just tested this on Ubuntu 18.04 with puppet 3.8.1 and it solved my problem.

“This” meaning the latest release? I.e., can we close this PR?

@KZachariassen
Copy link

I checked #814 directly - not the latest release, but I will do that first thing next week.

@wyardley wyardley closed this Jan 23, 2020
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.

3 participants