Issue #19998 has been updated by Amos Shapira.

I created Pull Reqeust https://github.com/puppetlabs/puppetlabs-stdlib/pull/140 
which implements any2array.
The other part, of making join() accept single-strings and just return them, is 
implemented in https://github.com/puppetlabs/puppetlabs-stdlib/pull/52, which 
was raised a year ago (Radmine #13202)


----------------------------------------
Feature #19998: Add "any2array" to puppet stdlib
https://projects.puppetlabs.com/issues/19998#change-87828

* Author: Amos Shapira
* Status: Unreviewed
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: 
----------------------------------------
Example scenario: I use extlookup() to read list of ldap server addresses from 
a .csv file then join() them in a string. In some environments (e.g. our old 
DC, Vagrant) there is only one value in the list, causing join() to fail 
because it receives a string where it expects an array.

There are two ways to solve this that I can think about:
1. always convert anything into an array. So far I managed to do that with 
"flatten([ $list_of_ldap_servers ])".
2. make join() accept a single none-array value and treat it as an array of one 
member.

I've just implemented "any2array" in stdlib to help with (1) and want to create 
a pull request for it as part of this issue, since I expect this to be useful 
in other situations.
I intend to submit a proposed implementation of (2) in a separate issue.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to