From f3b2e2e990349e357eba970c030f2655b5ddaf19 Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Wed, 18 Oct 2023 10:09:30 -0500 Subject: [PATCH] Remove use of File.exists? Replace calls to `File.exists?` with `File.exist?` for compatibility with Ruby 3 Closes #165 --- CHANGELOG | 4 ++++ lib/puppet/functions/ssh/autokey.rb | 4 ++-- metadata.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2c89333..b4ecd83 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +* Wed Oct 18 2023 Steven Pritchard - 6.16.1 +- Replace calls to `File.exists?` with `File.exist?` for compatibility with + Ruby 3 + * Wed Oct 11 2023 Steven Pritchard - 6.16.0 - [puppetsync] Updates for Puppet 8 - These updates may include the following: diff --git a/lib/puppet/functions/ssh/autokey.rb b/lib/puppet/functions/ssh/autokey.rb index 146f191..c5743a1 100644 --- a/lib/puppet/functions/ssh/autokey.rb +++ b/lib/puppet/functions/ssh/autokey.rb @@ -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}") @@ -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 diff --git a/metadata.json b/metadata.json index be9aa2f..4184e94 100644 --- a/metadata.json +++ b/metadata.json @@ -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",