Puppet Function: network::compact_hash
- Defined in:
- functions/compact_hash.pp
- Function type:
- Puppet Language
Summary
Compresses a hash by removing all elements whose values are `undef`Overview
13 14 15 16 |
# File 'functions/compact_hash.pp', line 13
function network::compact_hash(Hash $hash) >> Hash {
# Use the built-in `filter` function to remove all elements with `undef` values
$hash.filter |$key, $value| { $value != undef }
}
|