summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2017-09-27 10:12:15 +0100
committerGitHub <noreply@github.com>2017-09-27 10:12:15 +0100
commit0c6d82f543198f9316bc1d81cbd50a43c40052b0 (patch)
tree3144fe1ceaabf589354ad43d8ebd38a21fd64a69
parent5d039279d9ed1517f177c035da28070c8482ae20 (diff)
parentbefe885e2389882a167172b7bbe8d944e8bab535 (diff)
downloadchef-0c6d82f543198f9316bc1d81cbd50a43c40052b0.tar.gz
Merge pull request #6442 from dimsh99/fix_for_4850
fix password property is sensitive for mount resource
-rw-r--r--lib/chef/resource/mount.rb10
-rw-r--r--spec/unit/resource/mount_spec.rb2
2 files changed, 3 insertions, 9 deletions
diff --git a/lib/chef/resource/mount.rb b/lib/chef/resource/mount.rb
index 7e601b861a..9df2bbcdbc 100644
--- a/lib/chef/resource/mount.rb
+++ b/lib/chef/resource/mount.rb
@@ -34,6 +34,8 @@ class Chef
property :supports, Hash, default: lazy { { remount: false } },
coerce: proc { |x| x.is_a?(Array) ? x.each_with_object({}) { |i, m| m[i] = true } : x }
+ property :password, String, sensitive: true
+
def initialize(name, run_context = nil)
super
@mount_point = name
@@ -151,14 +153,6 @@ class Chef
)
end
- def password(arg = nil)
- set_or_return(
- :password,
- arg,
- :kind_of => [ String ]
- )
- end
-
def domain(arg = nil)
set_or_return(
:domain,
diff --git a/spec/unit/resource/mount_spec.rb b/spec/unit/resource/mount_spec.rb
index 466b6ac8c0..caa2e2f65a 100644
--- a/spec/unit/resource/mount_spec.rb
+++ b/spec/unit/resource/mount_spec.rb
@@ -205,7 +205,7 @@ describe Chef::Resource::Mount do
state = @resource.state_for_resource_reporter
expect(state[:mount_point]).to eq("T:")
expect(state[:username]).to eq("Administrator")
- expect(state[:password]).to eq("Jetstream123!")
+ expect(state[:password]).to eq("*sensitive value suppressed*")
expect(state[:domain]).to eq("TEST_DOMAIN")
expect(state[:device_type]).to eql(:device)
expect(state[:fstype]).to eq("auto")