Skip to content

Modules 707 #262

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

Merged
merged 2 commits into from
Oct 9, 2014
Merged

Modules 707 #262

merged 2 commits into from
Oct 9, 2014

Conversation

tremble
Copy link
Contributor

@tremble tremble commented May 23, 2014

Related to https://tickets.puppetlabs.com/browse/MODULES-707

Re-use existing str2bool code rather than doing a copy and paste.

Be slightly more relaxed about accepting objects which extend string/array rather than only allowing String/Array

@jhoblitt
Copy link

This looks like solid maintenance work -- many of the functions and their tests have been inconsistent in style for too long. 👍

The travis run was with puppet 3.6.1. I don't expect the type checking changes to break earlier versions of puppet but has this been tested with puppet < 3.5 ?

@tremble
Copy link
Contributor Author

tremble commented May 23, 2014

They're running fine against 3.3 and 2.7.24 but I've not run test cases against anything less than 3.5

…ring

We need to use

  unless value.is_a?(String) || value.is_a?(Array)

rather than

  klass = value.class
  unless [String, Array].include?(klass)

because the klass version enforces type checking which is too strict, and does
not allow us to accept objects wich have extended String (or Array).

For example, generate() function now returns Puppet::Util::Execution::ProcessOutput
which is just a very simple extension of String.  While this in it's self was
not intentional (PUP-2306) it is not unreasonable to cope with objects which
extend Strings
underscorgan pushed a commit that referenced this pull request Oct 9, 2014
@underscorgan underscorgan merged commit 0c0f7e1 into puppetlabs:master Oct 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants