puppetlabs-stdlib/lib/puppet
Leonardo Rodrigues de Mello 80a8b7bd1f (#20681) fix behaviour of delete_undef_values
The issue #20681 describe the error of delete() function
removing the elements from the origin array/hash/string.

This issue affected other delete functions. Because
ruby delete and delete_if functions make destructive
changes to the origin array/hash.

The delete_undef_values removed elements from the
origin array/hash and this is not the desired behaviour.

To solve this, we should dup or clone the array/hash
before using the delete or delete_if ruby functions.

We should also check if args[0] is not nil before using
dup, since dup on nil raises exception.

This fix the problem and add unit tests, so we could
enforce this behaviour and prevent regressions.
2013-09-18 11:19:52 -03:00
..
parser/functions (#20681) fix behaviour of delete_undef_values 2013-09-18 11:19:52 -03:00
provider/file_line (#21416) Allow file_line to match multiple lines 2013-07-11 16:25:56 -07:00
type (#21416) Allow file_line to match multiple lines 2013-07-11 16:25:56 -07:00