-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Remove deprecated validate_*
#66
Conversation
This is the same as voxpupuli#65 but now using datatypes instead of the validate_legacy function.
The has_key function is deprecated, using an internal Puppet function instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I detailed some minor issues with the data types. I have no experience with this module and maybe adding more validation to the various Hash
would be great, but it is a good start, thanks for this effort!
$download_url = undef, | ||
$install_dir = $winlogbeat::params::install_dir, | ||
$tmp_dir = $winlogbeat::params::tmp_dir, | ||
Optional[String] $major_version = undef, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An empty string is probably not acceptable?
Optional[String] $major_version = undef, | |
Optional[String[1]] $major_version = undef, |
As a rule of thumb, String
without a minimum length is a smell, and if ''
is a valid value, prefer String[0]
to make it explicit that an empty string is okay.
I will not report this for other occurrences in this file.
String $package_ensure = $winlogbeat::params::package_ensure, | ||
String $service_ensure = $winlogbeat::params::service_ensure, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stdlib has some helpers:
String $package_ensure = $winlogbeat::params::package_ensure, | |
String $service_ensure = $winlogbeat::params::service_ensure, | |
Stdlib::Ensure::Package $package_ensure = $winlogbeat::params::package_ensure, | |
Stdlib::Ensure::Service $service_ensure = $winlogbeat::params::service_ensure, |
String $service_ensure = $winlogbeat::params::service_ensure, | ||
Boolean $service_enable = $winlogbeat::params::service_enable, | ||
Optional[String] $service_provider = $winlogbeat::params::service_provider, | ||
String $registry_file = $winlogbeat::params::registry_file, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a Stdlib::Windowspath
more suitable?
String $install_dir = $winlogbeat::params::install_dir, | ||
String $tmp_dir = $winlogbeat::params::tmp_dir, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a Stdlib::Windowspath more suitable?
$metrics = undef, | ||
Boolean $use_generic_template = $winlogbeat::params::use_generic_template, | ||
Stdlib::Fqdn $beat_name = $winlogbeat::params::beat_name, | ||
Array $tags = $winlogbeat::params::tags, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's always good if we can qualify this more precisely, e.g. Array[String[1]]
for an array of non-emty strings.
Co-authored-by: Romain Tartière <[email protected]>
This is the same as #65 but now
using datatypes instead of the
validate_legacy function.
Pull Request (PR) description
This Pull Request (PR) fixes the following issues