summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-10-27 18:25:06 -0700
committerTim Smith <tsmith@chef.io>2018-10-27 18:25:06 -0700
commitb77556130458698025c0faf2771047a1b8ce5e82 (patch)
tree73d9a32e09292a3e5cbcb05073a85ed81fdddd91
parent401823a208ba11c6c32c68f0f94d8ac283bab452 (diff)
downloadchef-b77556130458698025c0faf2771047a1b8ce5e82.tar.gz
Fix dmg_name to actually work the way it was meant to
We created a variable with the same name as the property and this probably did the right thing in Chef 11, but what we really want is dmg_name to take on the app name by default. Now it does. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/resource/dmg_package.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/chef/resource/dmg_package.rb b/lib/chef/resource/dmg_package.rb
index 0c8c5da128..8a1a89562a 100644
--- a/lib/chef/resource/dmg_package.rb
+++ b/lib/chef/resource/dmg_package.rb
@@ -50,7 +50,9 @@ class Chef
description: "The Directory under /Volumes where the dmg is mounted as not all dmgs are mounted into a /Volumes location matching the name of the dmg."
property :dmg_name, String,
- description: "The name of the dmg if it is not the same as app, or if the name has spaces."
+ description: "The name of the dmg if it is not the same as app, or if the name has spaces.",
+ desired_state: false,
+ default: lazy { |r| r.app }
property :type, String,
description: "The type of package.",
@@ -91,7 +93,6 @@ class Chef
if current_resource.nil?
volumes_dir = new_resource.volumes_dir ? new_resource.volumes_dir : new_resource.app
- dmg_name = new_resource.dmg_name ? new_resource.dmg_name : new_resource.app
if new_resource.source
remote_file dmg_file do