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

Replace validate deprecated functions with data types #24

Closed
wants to merge 2 commits into from

Conversation

f1ngerscr0ssed
Copy link

Pull Request (PR) description

validate_* function from the puppetlabs/stdlib are deprecated and should be replaced by a call to validate_legacy or using data types.

Warning: This method is deprecated, please use the stdlib validate_legacy function,
                    with Stdlib::Compat::Bool. There is further documentation for validate_legacy function in the README. at ["C:/ProgramData/PuppetLabs/cod
e/environments/production/modules/winlogbeat/manifests/init.pp", 60]:
   (at C:/ProgramData/PuppetLabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:28:in `deprecation')
Warning: This method is deprecated, please use the stdlib validate_legacy function,
                    with Stdlib::Compat::Hash. There is further documentation for validate_legacy function in the README. at ["C:/ProgramData/PuppetLabs/cod
e/environments/production/modules/winlogbeat/manifests/init.pp", 103]:
   (at C:/ProgramData/PuppetLabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:28:in `deprecation')
Warning: This method is deprecated, please use the stdlib validate_legacy function,
                    with Stdlib::Compat::String. There is further documentation for validate_legacy function in the README. at ["C:/ProgramData/PuppetLabs/c
ode/environments/production/modules/winlogbeat/manifests/init.pp", 104]:
   (at C:/ProgramData/PuppetLabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:28:in `deprecation')

The params have been assigned a type based on the validate_type function that was used before.

manifests/init.pp Outdated Show resolved Hide resolved
$config_file = $winlogbeat::params::config_file,
$outputs = $winlogbeat::params::outputs,
Hash $outputs = $winlogbeat::params::outputs,
Copy link
Member

Choose a reason for hiding this comment

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

Can you enforce the structure of the hash?

validate_string($registry_file, $package_ensure)

if(!empty($proxy_address)){
if(!empty($proxy_address)){
validate_re($proxy_address, ['^(http(?:s)?\:\/\/[a-zA-Z0-9]+(?:(?:\.|\-)[a-zA-Z0-9]+)+(?:\:\d+)?(?:\/[\w\-]+)*(?:\/?|\/\w+\.[a-zA-Z]{2,4}(?:\?[\w]+\=[\w\-]+)?)?(?:\&[\w]+\=[\w\-]+)*)$'], 'ERROR: You must enter a proxy url in a valid format i.e. http://proxy.net:3128')
Copy link
Member

Choose a reason for hiding this comment

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

Should we save this regex as a custom datatype? the validate_re() method is deprecated as well.

@bastelfreak bastelfreak added needs-work not ready to merge just yet tests-fail labels Nov 18, 2018
@bastelfreak
Copy link
Member

Hi @f1ngerscr0ssed, thanks for the PR! Can you please take a look at the travis issues and the inline comments I made?

@vox-pupuli-tasks
Copy link

Dear @f1ngerscr0ssed, thanks for the PR!

This is Vox Pupuli Tasks, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

3 similar comments
@vox-pupuli-tasks
Copy link

Dear @f1ngerscr0ssed, thanks for the PR!

This is Vox Pupuli Tasks, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

@vox-pupuli-tasks
Copy link

Dear @f1ngerscr0ssed, thanks for the PR!

This is Vox Pupuli Tasks, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

@vox-pupuli-tasks
Copy link

Dear @f1ngerscr0ssed, thanks for the PR!

This is Vox Pupuli Tasks, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

@lucasmaurice
Copy link

lucasmaurice commented Jul 18, 2023

Hi there! Is it ok if I take care of this issue, as I need the module to be updated ?
And apparently @f1ngerscr0ssed will not continue on this one :D

@smortex
Copy link
Member

smortex commented Jul 18, 2023

Hi there! Is it ok if I take care of this issue, as I need the module to be updated ?

Of course! Feel free to open a new PR, I guess that you can add Fixes #24 to it's description that way this PR will be cloned when your PR is merged!

Thank you!

@zilchms
Copy link
Contributor

zilchms commented Feb 4, 2024

superseded by #68
Thanks for your contributions!

@zilchms zilchms closed this Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-conflicts needs-work not ready to merge just yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants