Skip to content

Commit

Permalink
Don't fail if first element of is not an hash before flattening
Browse files Browse the repository at this point in the history
The template is using [@rewrites].flatten.compact which maps to Puppet's delete_undef_values(flatten([]))

Bump stdlib version to the one introducing `delete_undef_values'.
  • Loading branch information
sathieu committed Dec 5, 2016
1 parent 2d70ca8 commit e8b9a50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion manifests/vhost.pp
Expand Up @@ -192,7 +192,8 @@
if $rewrites {
validate_array($rewrites)
unless empty($rewrites) {
validate_hash($rewrites[0])
$rewrites_flattened = delete_undef_values(flatten([$rewrites]))
validate_hash($rewrites_flattened[0])
}
}

Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Expand Up @@ -8,7 +8,7 @@
"project_page": "https://github.com/puppetlabs/puppetlabs-apache",
"issues_url": "https://tickets.puppetlabs.com/browse/MODULES",
"dependencies": [
{"name":"puppetlabs/stdlib","version_requirement":">= 2.4.0 < 5.0.0"},
{"name":"puppetlabs/stdlib","version_requirement":">= 4.2.0 < 5.0.0"},
{"name":"puppetlabs/concat","version_requirement":">= 1.1.1 < 3.0.0"}
],
"data_provider": null,
Expand Down

0 comments on commit e8b9a50

Please sign in to comment.