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

fix: permitting $backup to be boolean false #208

Merged
merged 1 commit into from
Aug 18, 2014
Merged

fix: permitting $backup to be boolean false #208

merged 1 commit into from
Aug 18, 2014

Conversation

flypenguin
Copy link

concat::backup can actually be a boolean false, which currently is not permitted by the validation, and should be. now it is :)

@jhoblitt
Copy link
Contributor

The unit tests need to be updated and I suspect the acceptance tests as well.

@flypenguin
Copy link
Author

updated the tests I found.

@jhoblitt
Copy link
Contributor

@flypenguin Thank you for updating the tests. Question - is there any reason not to allow backup to accept a true boolean value?

@flypenguin
Copy link
Author

because according to the File[] docs from puppetlabs (or as I understand
them :) the value for backup=> is either bool(false) or a string. I have no
clue what bool(true) might mean, so I made sure the value throws an error.

2014-08-13 16:12 GMT+02:00 Joshua Hoblitt notifications@github.com:

@flypenguin https://github.com/flypenguin Thank you for updating the
tests. Question - is there any reason not to allow backup to accept a true
boolean value?


Reply to this email directly or view it on GitHub
#208 (comment)
.

@jhoblitt
Copy link
Contributor

According to the type refernce, true is an alias for " .puppet-bak". https://docs.puppetlabs.com/references/latest/type.html#file-attribute-backup

How about someting along the lines of:

if !(is_string($backup) or is_bool($backup)) {
  fail('$backup is not a string or bool.')
}

?

@flypenguin
Copy link
Author

oops must have missed that. sure that's the better way then. I can do it tomorrow if you like.—
Sent from Mailbox

On Wed, Aug 13, 2014 at 4:54 PM, Joshua Hoblitt notifications@github.com
wrote:

According to the type refernce, true is an alias for " .puppet-bak". https://docs.puppetlabs.com/references/latest/type.html#file-attribute-backup
How about someting along the lines of:

if !(is_string($backup) or is_bool($backup)) {
  fail('$backup is not a string or bool.')
}

?

Reply to this email directly or view it on GitHub:
#208 (comment)

@flypenguin
Copy link
Author

sorry, took a while longer. both string and boolean values are permitted now.

@jhoblitt
Copy link
Contributor

Looks good. Thank you for contributing!

jhoblitt pushed a commit that referenced this pull request Aug 18, 2014
fix: permitting $backup to be boolean false
@jhoblitt jhoblitt merged commit cc1e654 into puppetlabs:master Aug 18, 2014
@flypenguin
Copy link
Author

my pleasure :)

@flypenguin flypenguin deleted the mods branch August 18, 2014 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants