Issue #7319 has been reported by Roberto Bouza.
----------------------------------------
Bug #7319: regsubst needs double quotes when variable gets assigned a
"nil/undef" from an non existent item in array.
https://projects.puppetlabs.com/issues/7319
Author: Roberto Bouza
Status: Unreviewed
Priority: High
Assignee:
Category: functions
Target version:
Affected Puppet version: 2.6.4
Keywords:
Branch:
Hello,
Going through the style sheet I was modifying some classes and I hit
this, maybe a bug maybe not:
--- test.pp ---
$myvar = 'aebec:aebec'
$splitted = split($myvar, ':')
# Intentionally getting a nil/empty/not there/ element from the array
#
$test = $splitted[4]
alert($test)
# This doesn't work
$no_dq = regsubst($test, 'e', ',', 'G')
alert($no_dq)
# This works but is not the style standard way of using a single
variable
$with_dq = regsubst("$test", 'e', ',', 'G')
alert($with_dq)
--- end test.pp ---
puppet apply test.pp
alert: Scope(Class[main]):
alert: Scope(Class[main]): e
alert: Scope(Class[main]):
Any help will be appreciated.
Thank you.
--
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.