summaryrefslogtreecommitdiff
path: root/lib/chef/provider/user
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-04-01 10:12:27 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2017-04-01 10:12:27 -0700
commit9a42b4d5588013d36e4357702911119400cc1ef4 (patch)
tree05607cc55129ba139369b470849417e3f491176e /lib/chef/provider/user
parentad3ef0854ffd962f7d124612ee0bad18115212c5 (diff)
downloadchef-9a42b4d5588013d36e4357702911119400cc1ef4.tar.gz
convert remaining popen4 code to shell_out
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/provider/user')
-rw-r--r--lib/chef/provider/user/pw.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/chef/provider/user/pw.rb b/lib/chef/provider/user/pw.rb
index cf47bb7fde..06bd221d26 100644
--- a/lib/chef/provider/user/pw.rb
+++ b/lib/chef/provider/user/pw.rb
@@ -94,13 +94,7 @@ class Chef
if !new_resource.password.nil? && (current_resource.password != new_resource.password)
Chef::Log.debug("#{new_resource} updating password")
command = "pw usermod #{new_resource.username} -H 0"
- status = popen4(command, waitlast: true) do |pid, stdin, stdout, stderr|
- stdin.puts new_resource.password.to_s
- end
-
- unless status.exitstatus == 0
- raise Chef::Exceptions::User, "pw failed - #{status.inspect}!"
- end
+ shell_out!(command, input: new_resource.password.to_s)
else
Chef::Log.debug("#{new_resource} no change needed to password")
end