Skip to content

Commit 1f69209

Browse files
adamruzickaekohl
authored andcommitted
Fixes #33002 - Do not use deprecated net-ssh options
Additionally fixes a similar error with the value. :paranoid is deprecated, please use :verify_host_key. Supported values are exactly the same, only the name of the option has changed.
1 parent f961831 commit 1f69209

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/smart_proxy_remote_execution_ssh/runners/script_runner.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ class ScriptRunner < Proxy::Dynflow::Runner::Base
102102
EXPECTED_POWER_ACTION_MESSAGES = ['restart host', 'shutdown host'].freeze
103103
DEFAULT_REFRESH_INTERVAL = 1
104104
MAX_PROCESS_RETRIES = 4
105+
VERIFY_HOST_KEY = Gem::Version.create(Net::SSH::Version::STRING) < Gem::Version.create('5.0.0') ||
106+
:accept_new_or_local_tunnel
105107

106108
def initialize(options, user_method, suspended_action: nil)
107109
super suspended_action: suspended_action
@@ -273,7 +275,7 @@ def ssh_options
273275
ssh_options[:keys_only] = true
274276
# if the host public key is contained in the known_hosts_file,
275277
# verify it, otherwise, if missing, import it and continue
276-
ssh_options[:paranoid] = true
278+
ssh_options[:verify_host_key] = VERIFY_HOST_KEY
277279
ssh_options[:auth_methods] = available_authentication_methods
278280
ssh_options[:user_known_hosts_file] = prepare_known_hosts if @host_public_key
279281
ssh_options[:number_of_password_prompts] = 1

smart_proxy_remote_execution_ssh.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ Gem::Specification.new do |gem|
3030
gem.add_development_dependency('rubocop', '~> 0.82.0')
3131

3232
gem.add_runtime_dependency('smart_proxy_dynflow', '~> 0.5')
33-
gem.add_runtime_dependency('net-ssh')
33+
gem.add_runtime_dependency('net-ssh', '>= 4.2.0')
3434
end

0 commit comments

Comments
 (0)