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($result, $value)}
>
> so if
>
>   $dataset = {
>     name1 => {
>       attr1 =>
>       attr2 =>
>       remove_key1 =>
>       remove_key2 =>
>       remove_key3 =>
>       attr3 =>
>       }
>       }
>
> it will end up
>
>   $_dataset = {
>     name1 => {
>       attr1 =>
>       attr2 =>
>       attr3 =>
>       }
>       }
>
> So it's working.
>
> But why this *not* working ?
>
> class  (
>   Optional[Hash] $remove_key = ['remove_key1','remove_key2','remove_key3'],
>   )
>   {
>
>   $_dataset = reduce($dataset.map |$key, $value| { {$key => 
> delete($value,$remove_key)} }) | $result, $value | { deep_merge($result, 
> $value)}
>
>   }

Why it's not working ? Because I'm stupid. I've be fool by hiera with some
key on other file.

So everything work well.

Regards.

--
Albert SHIH
Observatoire de Paris
xmpp: [email protected]
Heure local/Local time:
Thu 06 Jun 2019 01:33:12 PM CEST

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20190606113418.GG12167%40io.chezmoi.fr.
For more options, visit https://groups.google.com/d/optout.

Reply via email to