summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-07-16 20:16:39 -0700
committerTim Smith <tsmith84@gmail.com>2020-07-20 11:45:27 -0700
commitf0a336a0257a610ccb7b461eaab12a8fc0815c4f (patch)
tree478d91cae7a2cd820d01eedb0c833917bccc1a3d
parente5e9497af684b6439278dbd756529633feef7e0c (diff)
downloadchef-f0a336a0257a610ccb7b461eaab12a8fc0815c4f.tar.gz
Trade a bit of memory for slightly slower debug runs
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/resource/macos_userdefaults.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/chef/resource/macos_userdefaults.rb b/lib/chef/resource/macos_userdefaults.rb
index c739cbabe2..3be0486496 100644
--- a/lib/chef/resource/macos_userdefaults.rb
+++ b/lib/chef/resource/macos_userdefaults.rb
@@ -111,17 +111,15 @@ class Chef
end
load_current_value do |desired|
- state_cmd = defaults_export_cmd(desired)
-
- Chef::Log.debug "#load_current_value: shelling out \"#{state_cmd.join(" ")}\" to determine state"
+ Chef::Log.debug "#load_current_value: shelling out \"#{defaults_export_cmd(desired).join(" ")}\" to determine state"
state = if desired.user.nil?
- shell_out(state_cmd)
+ shell_out(defaults_export_cmd(desired))
else
- shell_out(state_cmd, user: desired.user)
+ shell_out(defaults_export_cmd(desired), user: desired.user)
end
if state.error? || state.stdout.empty?
- Chef::Log.debug "#load_current_value: #{state_cmd.join(" ")} returned stdout: #{state.stdout} and stderr: #{state.stderr}"
+ Chef::Log.debug "#load_current_value: #{defaults_export_cmd(desired).join(" ")} returned stdout: #{state.stdout} and stderr: #{state.stderr}"
current_value_does_not_exist!
end