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

Fixes integer validation in Puppet 4 #62

Closed
wants to merge 1 commit into from
Closed

Conversation

p--b
Copy link

@p--b p--b commented Sep 21, 2015

Case regex validation only succeeds on strings, which is somewhat
troublesome when using them to validate integers. By forcing any
passed integers to be strings, we cause integers to match the regex as
desired.

This fixes #46

Case regex validation only succeeds on strings, which is somewhat
troublesome when using them to validate integers. By forcing any
passed integers to be strings, we cause integers to match the regex as
desired.
@p--b
Copy link
Author

p--b commented Sep 21, 2015

The CI fails on WARNING: string containing only a variable --- which is the whole point. AFAIK there's not a better way to force this conversion?

I did try running cibuild but it bailed with /home/peter/git/puppet-logrotate/vendor/gems/ruby/2.1.0/gems/puppet-3.2.1/lib/puppet/util/autoload.rb:68:in 'rescue in load_file': Could not autoload puppet/type/component: can't modify frozen Symbol (Puppet::Error)

@p--b p--b mentioned this pull request Oct 14, 2015
@pioto
Copy link

pioto commented Apr 7, 2017

Agreed, looks like there's not really any other obvious way to convert a number to a string:

https://docs.puppet.com/puppet/4.9/lang_data_number.html#converting-numbers-to-strings

@p--b
Copy link
Author

p--b commented May 9, 2021

The world has moved on, and I have stopped caring.

@p--b p--b closed this May 9, 2021
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.

rotate must be an integer
2 participants