summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-10-28 19:58:36 -0700
committerTim Smith <tsmith@chef.io>2018-10-28 19:58:36 -0700
commit883269249d175fc1bed6a445e1ccecaf0c9881c4 (patch)
tree57fcc44102a04d0a4942ee674c02ddd1a52ce2c4
parentde55858248a59e2d20374b9e19c3f21934d4a736 (diff)
downloadchef-883269249d175fc1bed6a445e1ccecaf0c9881c4.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.rb2
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