diff options
author | Tim Smith <tsmith@chef.io> | 2018-10-27 18:25:38 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-10-27 18:25:38 -0700 |
commit | 8f8517eabf7cfeb7f59c4081fda191352ff2047d (patch) | |
tree | b3fdc5b71667b68f7523c0530bf6a43e79c7bc7c /lib | |
parent | b77556130458698025c0faf2771047a1b8ce5e82 (diff) | |
download | chef-8f8517eabf7cfeb7f59c4081fda191352ff2047d.tar.gz |
Remove declare_resource usage
This isn't necessary since this is a custom resource
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/resource/dmg_package.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/chef/resource/dmg_package.rb b/lib/chef/resource/dmg_package.rb index 8a1a89562a..fabfbce1a8 100644 --- a/lib/chef/resource/dmg_package.rb +++ b/lib/chef/resource/dmg_package.rb @@ -116,11 +116,11 @@ class Chef case new_resource.type when "app" - declare_resource(:execute, "rsync --force --recursive --links --perms --executability --owner --group --times '/Volumes/#{volumes_dir}/#{new_resource.app}.app' '#{new_resource.destination}'") do + execute "rsync --force --recursive --links --perms --executability --owner --group --times '/Volumes/#{volumes_dir}/#{new_resource.app}.app' '#{new_resource.destination}'" do user new_resource.owner if new_resource.owner end - declare_resource(:file, "#{new_resource.destination}/#{new_resource.app}.app/Contents/MacOS/#{new_resource.app}") do + file "#{new_resource.destination}/#{new_resource.app}.app/Contents/MacOS/#{new_resource.app}" do mode "755" ignore_failure true end @@ -128,17 +128,18 @@ class Chef install_cmd = "installation_file=$(ls '/Volumes/#{volumes_dir}' | grep '.#{new_resource.type}$') && sudo installer -pkg \"/Volumes/#{volumes_dir}/$installation_file\" -target /" install_cmd += " -allowUntrusted" if new_resource.allow_untrusted - declare_resource(:execute, install_cmd) do + execute install_cmd do # Prevent cfprefsd from holding up hdiutil detach for certain disk images environment("__CFPREFERENCES_AVOID_DAEMON" => "1") end end - declare_resource(:execute, "hdiutil detach '/Volumes/#{volumes_dir}' || hdiutil detach '/Volumes/#{volumes_dir}' -force") + execute "hdiutil detach '/Volumes/#{volumes_dir}' || hdiutil detach '/Volumes/#{volumes_dir}' -force" end end action_class do + # @return [String] the path to the dmg file def dmg_file @dmg_file ||= begin if new_resource.file.nil? |