summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCrae <john.mccrae@progress.com>2022-10-03 02:46:20 +0000
committerJohn McCrae <john.mccrae@progress.com>2022-10-03 02:46:20 +0000
commit01d9767b63f08191ca69925d965468fe2ba27d4b (patch)
treebaeb9b5edd8a323f1a3ea5bd23638017cdfe5353
parentfd75ffafa8d79e950ea618b19177a761347a130d (diff)
downloadchef-01d9767b63f08191ca69925d965468fe2ba27d4b.tar.gz
replacing Tempfile.new with Tempfile.create
Signed-off-by: John McCrae <john.mccrae@progress.com>
-rw-r--r--lib/chef/chef_fs/command_line.rb6
-rw-r--r--spec/unit/mixin/openssl_helper_spec.rb3
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/chef/chef_fs/command_line.rb b/lib/chef/chef_fs/command_line.rb
index a33d7cc903..15ee15ae30 100644
--- a/lib/chef/chef_fs/command_line.rb
+++ b/lib/chef/chef_fs/command_line.rb
@@ -291,8 +291,10 @@ class Chef
rescue => e
"!!! Unable to diff #{old_path} and #{new_path} due to #{e}"
ensure
- old_tempfile.close!
- new_tempfile.close!
+ # old_tempfile.close!
+ # new_tempfile.close!
+ old_tempfile.close
+ new_tempfile.close
end
end
end
diff --git a/spec/unit/mixin/openssl_helper_spec.rb b/spec/unit/mixin/openssl_helper_spec.rb
index 3116651e43..1073b648de 100644
--- a/spec/unit/mixin/openssl_helper_spec.rb
+++ b/spec/unit/mixin/openssl_helper_spec.rb
@@ -178,7 +178,8 @@ describe Chef::Mixin::OpenSSLHelper do
end
after(:each) do
- @keyfile.unlink
+ # @keyfile.unlink
+ @keyfile.close
end
end