diff options
-rw-r--r-- | lib/chef/resource/mount.rb | 11 | ||||
-rw-r--r-- | spec/unit/resource/mount_spec.rb | 2 |
2 files changed, 4 insertions, 9 deletions
diff --git a/lib/chef/resource/mount.rb b/lib/chef/resource/mount.rb index 7e601b861a..6ea37d760f 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 @@ -147,14 +149,7 @@ class Chef set_or_return( :username, arg, - :kind_of => [ String ] - ) - end - - def password(arg = nil) - set_or_return( - :password, - arg, + :sensitive => true, :kind_of => [ String ] ) end 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") |