This repository has been archived by the owner on Apr 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Steve Huff
committed
Sep 30, 2015
1 parent
29e3504
commit d4d7dd3
Showing
2 changed files
with
23 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'deep_merge' | ||
|
||
module Puppet::Parser::Functions | ||
newfunction(:merge_hashes, :type => :rvalue, :doc => "Performs a deep merge on multiple hashes passed in as arguments.") do |args| | ||
begin | ||
merged = {} | ||
|
||
args.each do |arg| | ||
merged.deep_merge!(arg, { :merge_hash_arrays => true }) | ||
end | ||
|
||
merged | ||
|
||
rescue StandardError => e | ||
raise Puppet::ParseError, e.message | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters