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

Validate bind view parameters #796

Merged
merged 3 commits into from
May 22, 2018
Merged

Conversation

smortex
Copy link
Member

@smortex smortex commented May 21, 2018

Pull Request (PR) description

This tiny Pull-Request add a custom type for validating the values passed to $collectd::plugin::bind::views. Without this safety belt, you can end up with a useless (but surprisingly valid!) configuration file:

<Plugin bind>
  [...]
  <View "">
  </View>
  <View "">
  </View>
</Plugin>

This Pull Request (PR) fixes the following issues

n/a

Boolean $resolverstats = false,
Boolean $serverstats = true,
Boolean $zonemaintstats = true,
Array[Collectd::Bind::View] $views = [],
Copy link
Member

Choose a reason for hiding this comment

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

custom datatype \o/

@bastelfreak
Copy link
Member

Hi @smortex, thanks for the patch! Can you add a unit test that verifies that this is now working (provide any valid data to $views)

@smortex
Copy link
Member Author

smortex commented May 21, 2018

@bastelfreak done :-) I am neither satisfied by matching lines independently (multiple lines would match when using views) and matching multiple lines in a single test (not easily readable). If you have some advice/opinion regarding this, I would be happy to learn it!

@smortex
Copy link
Member Author

smortex commented May 22, 2018

Ooops, rubocop is not configured to enforce trailing comas 😄 I might have missed a mail from Travis-CI… Fixed BTW!

@bastelfreak bastelfreak merged commit b42be01 into voxpupuli:master May 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants