Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
PUP 4.10.0
Description
https://puppet.com/docs/puppet/5.3/function.html#conversion-to-string
and
http://puppet-on-the-edge.blogspot.com/2016/05/converting-and-formatting-data-like-pro.html both have examples of how to get Puppet to format strings when converting from Arrays.
eg.
$str = String([10], "%(a") # produces '("10")'
|
# Formatting with indentation
|
String([1, [2, 3], 4], "%#a")
|
# produces:
|
# [1,
|
# [2, 3],
|
# 4]
|
It appears these examples haven't worked since puppet 4.8 (they work in 4.7.1).
The long form still works.
eg
String([1, [2, 3], 4], Array => { format => "%#a"})
|