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 deprecated validate_* functions #443

Merged

Conversation

baurmatt
Copy link
Contributor

Pull Request (PR) description

This Pull Request (PR) fixes the following issues

@baurmatt baurmatt force-pushed the fix/validate_function_deprecation branch from 7d50e03 to 2a706db Compare October 26, 2018 10:41
#}
validate_re($version, concat(['system', 'pypy'], $valid_versions))
$allowed_versions = concat(['system', 'pypy'], $valid_versions)
unless $version =~ Enum[$allowed_versions] {
Copy link
Member

Choose a reason for hiding this comment

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

Should this be unless $version in $allowed_versions if it's an array? Not sure what the data type of $valid_versions is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

$valid_versions, when taken from python::params, is an array. But even if it would be a string, the concat() would generate an array for $allowed_versions. I guess one could also use the in syntax you suggested. Not sure that the performance difference is.

@baurmatt
Copy link
Contributor Author

Is there a better way to verify data type errors then matching it with a Regex? Because for some reasons the output changes between Puppet 4,5 and 6....

@baurmatt baurmatt force-pushed the fix/validate_function_deprecation branch from 2a706db to 583d68f Compare October 26, 2018 12:41
@wyardley
Copy link
Contributor

Sorry, this may now have some conflicts now that I merged #440

@baurmatt baurmatt force-pushed the fix/validate_function_deprecation branch from 583d68f to 13b725d Compare October 29, 2018 08:14
@baurmatt
Copy link
Contributor Author

No worries! :) Rebased the branch.

@bastelfreak
Copy link
Member

Thanks for the PR @baurmatt !

@bastelfreak bastelfreak merged commit f274e51 into voxpupuli:master Nov 2, 2018
@morremeyer morremeyer deleted the fix/validate_function_deprecation branch June 13, 2019 14:55
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.

4 participants