summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Vandewiele <reid@puppetlabs.com>2017-06-28 13:37:55 -0700
committerReid Vandewiele <reid@puppetlabs.com>2017-06-28 13:37:55 -0700
commitec6cd56576953c74b48ebbba477d89e138e91ace (patch)
tree7e5cbaad4a995f2af1045777781ff5ac45a1ef08
parentb98f0b3fc113b97cef618e0e6cb09bfdb666e467 (diff)
(MODULES-5113) Make line support Sensitive
Do this by making it a property. The idea is to get rid of the warning that appears when a Sensitive value is passed to the line attribute.
-rw-r--r--lib/puppet/type/file_line.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/puppet/type/file_line.rb b/lib/puppet/type/file_line.rb
index e82b246..3d691bf 100644
--- a/lib/puppet/type/file_line.rb
+++ b/lib/puppet/type/file_line.rb
@@ -104,8 +104,16 @@ Puppet::Type.newtype(:file_line) do
' This is also takes a regex.'
end
- newparam(:line) do
+ # The line property never changes; the type only ever performs a create() or
+ # destroy(). line is a property in order to allow it to correctly handle
+ # Sensitive type values. Because it is a property which will never change,
+ # it should never be considered out of sync.
+ newproperty(:line) do
desc 'The line to be appended to the file or used to replace matches found by the match attribute.'
+
+ def retrieve
+ @resource[:line]
+ end
end
newparam(:path) do