summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-10-28 20:43:14 -0700
committerTim Smith <tsmith@chef.io>2018-10-31 12:37:44 -0700
commit6e2683ef7e5ad05421498603ff1337d9c1f970fd (patch)
treee4e26349c8da6e48ebab5fe6c74fb72a69d3f0fb
parent2a4ae0725a67bf974005a3a56d7d27f101647a00 (diff)
downloadchef-6e2683ef7e5ad05421498603ff1337d9c1f970fd.tar.gz
Fix accepting the EULA not working
Turns out it was breaking due to the quiet flag. Sadly there was a PR to turn off this flag from 3 years ago in the old cookbook repo :( Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/resource/dmg_package.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/chef/resource/dmg_package.rb b/lib/chef/resource/dmg_package.rb
index d721f64ba9..17645e519b 100644
--- a/lib/chef/resource/dmg_package.rb
+++ b/lib/chef/resource/dmg_package.rb
@@ -104,8 +104,11 @@ class Chef
ruby_block "attach #{dmg_file}" do
block do
raise "This DMG package requires EULA acceptance. Add 'accept_eula true' to dmg_package resource to accept the EULA during installation." if software_license_agreement? && !new_resource.accept_eula
- accept_eula_cmd = new_resource.accept_eula ? "echo Y | echo Y | PAGER=true " : ""
- shell_out!("#{accept_eula_cmd} /usr/bin/hdiutil attach #{passphrase_cmd} '#{dmg_file}' -nobrowse -mountpoint '/Volumes/#{new_resource.volumes_dir}' -quiet", env: { "PAGER" => "true" })
+
+ attach_cmd = new_resource.accept_eula ? "yes | " : ""
+ attach_cmd << "/usr/bin/hdiutil attach #{passphrase_cmd} '#{dmg_file}' -nobrowse -mountpoint '/Volumes/#{new_resource.volumes_dir}'"
+
+ shell_out!(attach_cmd, env: { "PAGER" => "true" })
end
not_if { dmg_attached? }
end