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

Ensure version fact does not throw an error for invalid match #705

Merged
merged 2 commits into from
Jun 25, 2018

Conversation

ctrox
Copy link
Contributor

@ctrox ctrox commented Jun 22, 2018

Pull Request (PR) description

If the rabbitmq_version string returned from rabbitmqadmin --version contains invalid characters it throws an error because the array is nil. This will make a empty array out of it so it won't throw an error in that case.

This Pull Request (PR) fixes the following issues

Fixes #704

@wyardley
Copy link
Contributor

This seems sensible to me (though keep in mind that the module does use the version fact to determine some things about how it operates, so it may not operate correctly if the version is nil).

Can you add a spec test test for a nil value with an invalid version value?
https://github.com/voxpupuli/puppet-rabbitmq/blob/master/spec/unit/facter/util/fact_rabbitmq_version_spec.rb

Copy link
Member

@dhollinger dhollinger left a comment

Choose a reason for hiding this comment

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

As per @wyardley's request, please add/update the unit tests to account for your changes

@wyardley wyardley self-requested a review June 25, 2018 18:38
@wyardley
Copy link
Contributor

@dhollinger from my perspective, good to ship it

@dhollinger dhollinger merged commit a5d97f1 into voxpupuli:master Jun 25, 2018
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.

rabbitmq_version fact fails on Ubuntu 18.04
3 participants