Skip to content

Commit

Permalink
Remove use of File.exists?
Browse files Browse the repository at this point in the history
Replace calls to `File.exists?` with `File.exist?` for compatibility
with Ruby 3

Closes simp#165
  • Loading branch information
silug committed Oct 18, 2023
1 parent eeec64f commit f3b2e2e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* Wed Oct 18 2023 Steven Pritchard <[email protected]> - 6.16.1
- Replace calls to `File.exists?` with `File.exist?` for compatibility with
Ruby 3

* Wed Oct 11 2023 Steven Pritchard <[email protected]> - 6.16.0
- [puppetsync] Updates for Puppet 8
- These updates may include the following:
Expand Down
4 changes: 2 additions & 2 deletions lib/puppet/functions/ssh/autokey.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def autokey(username, key_strength=nil, return_private=nil)
end
end

if ( !File.exists?("#{keydir}/#{username}") )
if ( !File.exist?("#{keydir}/#{username}") )
begin
Timeout::timeout(30) do
Puppet::Util::Execution.execute("/usr/bin/ssh-keygen -N '' -q -t rsa -C '' -b #{key_strength} -f #{keydir}/#{username}")
Expand All @@ -83,7 +83,7 @@ def autokey(username, key_strength=nil, return_private=nil)
end
end

if ( File.exists?("#{keydir}/#{username}.pub") )
if ( File.exist?("#{keydir}/#{username}.pub") )
if return_private
retval = File.read("#{keydir}/#{username}")
else
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simp-ssh",
"version": "6.16.0",
"version": "6.16.1",
"author": "SIMP Team",
"summary": "Manage ssh",
"license": "Apache-2.0",
Expand Down

0 comments on commit f3b2e2e

Please sign in to comment.