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 parameters that take hash or array of hashes #327

Merged
merged 1 commit into from
Aug 28, 2013

Conversation

hunner
Copy link
Contributor

@hunner hunner commented Aug 28, 2013

The method used to cast scalars to arrays is Array(). This also will
cast nil to an empty array, and preserve array depth for existing
arrays.

Casting hashes to arrays with Array() produces strange results and so
the more verbose form of [hsh].flatten.compact must be used when a
parameter may be one or more hashes. This updates the tests and
templates accordingly.

The method used to cast scalars to arrays is `Array()`. This also will
cast `nil` to an empty array, and preserve array depth for existing
arrays.

Casting hashes to arrays with `Array()` produces strange results and so
the more verbose form of `[hsh].flatten.compact` must be used when a
parameter may be one or more hashes. This updates the tests and
templates accordingly.
apenney pushed a commit that referenced this pull request Aug 28, 2013
Fix parameters that take hash or array of hashes
@apenney apenney merged commit a298b73 into puppetlabs:master Aug 28, 2013
@hunner hunner deleted the fix_array_hashes branch August 28, 2013 18:24
traylenator pushed a commit to traylenator/puppetlabs-apache that referenced this pull request Jun 7, 2022
* More idiomatic usage of parens for 'fail translate(('

* Change '((' to more idiomatic usage in install & service.pp
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.

None yet

3 participants