13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/puppet/parser/functions/merge_hardening.rb', line 13
def deep_merge_hardening user_param, hardening_param, name
if user_param.instance_of? Hash and
hardening_param.instance_of? Hash
hardening_param.each do |k,v|
if not user_param.key? k
user_param[k] = v
next
end
user_param[k] = deep_merge_hardening user_param[k], hardening_param[k], "#{name}[#{k}]"
end
else
if user_param.nil?
user_param = hardening_param
end
if user_param != hardening_param
Puppet.warning "Hardening parameters: you already defined '#{name}' as '#{user_param}'. "+
"Hardening recommends to use '#{hardening_param}'."
end
end
user_param
end
|