diff options
author | Tim Smith <tsmith@chef.io> | 2018-10-28 19:58:36 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-10-31 12:37:37 -0700 |
commit | b10c5af41301481338c37c4e046b8cae31e633da (patch) | |
tree | 0a6c55b293676ca04b83030a1ad84f13bde2550c | |
parent | 3d09465449092c2cfe68cec0800c5d5a2a949a55 (diff) | |
download | chef-b10c5af41301481338c37c4e046b8cae31e633da.tar.gz |
memoize passphrase_cmd
We access this multiple times in this resource
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/chef/resource/dmg_package.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/resource/dmg_package.rb b/lib/chef/resource/dmg_package.rb index a5c7a3923f..5387f8af68 100644 --- a/lib/chef/resource/dmg_package.rb +++ b/lib/chef/resource/dmg_package.rb @@ -148,7 +148,7 @@ class Chef # @return [String] the hdiutil flag for handling DMGs with a password def passphrase_cmd - new_resource.dmg_passphrase ? "-passphrase #{new_resource.dmg_passphrase}" : "" + @passphrase_cmd ||= new_resource.dmg_passphrase ? "-passphrase #{new_resource.dmg_passphrase}" : "" end # @return [Boolean] does the DMG require a software license agreement |