X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=meta-stx%2Frecipes-support%2Fpuppet%2Ffiles%2Fpuppetlabs-stdlib%2F0001-Filter-password-in-logs.patch;fp=meta-stx%2Frecipes-support%2Fpuppet%2Ffiles%2Fpuppetlabs-stdlib%2F0001-Filter-password-in-logs.patch;h=73f7267bfa2ceb32caa3c12ffc9a18daab4ad166;hb=57fdea704bd62af847872c40508f00aa1d7cac60;hp=0000000000000000000000000000000000000000;hpb=f23f21bccfb750b9e30141fd9676515215ffbc4e;p=pti%2Frtp.git diff --git a/meta-stx/recipes-support/puppet/files/puppetlabs-stdlib/0001-Filter-password-in-logs.patch b/meta-stx/recipes-support/puppet/files/puppetlabs-stdlib/0001-Filter-password-in-logs.patch new file mode 100644 index 0000000..73f7267 --- /dev/null +++ b/meta-stx/recipes-support/puppet/files/puppetlabs-stdlib/0001-Filter-password-in-logs.patch @@ -0,0 +1,36 @@ +From d95ec2abaa68a1da308c3c8b01c700fcc544a788 Mon Sep 17 00:00:00 2001 +From: Don Penney +Date: Mon, 1 May 2017 14:37:22 -0400 +Subject: [PATCH] Filter password in logs + +--- + lib/puppet/parser/functions/ensure_resource.rb | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/lib/puppet/parser/functions/ensure_resource.rb b/lib/puppet/parser/functions/ensure_resource.rb +index 1ba6a44..b9c3242 100644 +--- a/lib/puppet/parser/functions/ensure_resource.rb ++++ b/lib/puppet/parser/functions/ensure_resource.rb +@@ -30,15 +30,17 @@ ENDOFDOC + raise(ArgumentError, 'Must specify a type') unless type + raise(ArgumentError, 'Must specify a title') unless title + params ||= {} ++ filtered_params = Marshal.load(Marshal.dump(params)) # deep copy ++ filtered_params.delete("password") + + items = [title].flatten + + items.each do |item| + Puppet::Parser::Functions.function(:defined_with_params) + if function_defined_with_params(["#{type}[#{item}]", params]) +- Puppet.debug("Resource #{type}[#{item}] with params #{params} not created because it already exists") ++ Puppet.debug("Resource #{type}[#{item}] with params #{filtered_params} not created because it already exists") + else +- Puppet.debug("Create new resource #{type}[#{item}] with params #{params}") ++ Puppet.debug("Create new resource #{type}[#{item}] with params #{filtered_params}") + Puppet::Parser::Functions.function(:create_resources) + function_create_resources([type.capitalize, { item => params }]) + end +-- +1.8.3.1 +