Re: [Puppet Users] map/reduce local variables

2019-06-06 Thread Albert Shih
Le 05/06/2019 à 17:24:26-0700, chengkai liang a écrit Hi, Thanks for the help. > I believed you made thing overly complicated. You only have one hash table, > and > try to remove the entries that has remove_ of it. Not sure why you need to use > reduce and map. You can use `each` to go through

Re: [Puppet Users] map/reduce local variables

2019-06-06 Thread Albert Shih
Le 05/06/2019 à 17:09:14+0200, Albert Shih a écrit > Hi > > I try to write a code to delete some key inside a hash. So I got this > > $_dataset = reduce($dataset.map |$key, $value| { {$key => > delete($value,['remove_key1','remove_key2','remove_key3'])} }) | $result, > $value | { deep_merge($re

Re: [Puppet Users] map/reduce local variables

2019-06-05 Thread chengkai liang
I believed you made thing overly complicated. You only have one hash table, and try to remove the entries that has remove_ of it. Not sure why you need to use reduce and map. You can use `each` to go through first key of the hash table, then use filter to filter out unwanted keys like, # this clas