Skip to content

Commit 0f8a2be

Browse files
committed
Fixes #33682 - Slightly better handling of async_ssh setting
1 parent 6462ce5 commit 0f8a2be

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

lib/smart_proxy_remote_execution_ssh.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,20 @@ def validate_mode!
4040
unless Plugin::MODES.include? Plugin.settings.mode
4141
raise "Mode has to be one of #{Plugin::MODES.join(', ')}, given #{Plugin.settings.mode}"
4242
end
43+
44+
if Plugin.settings.async_ssh
45+
Plugin.logger.warn('Option async_ssh is deprecated, use ssh-async mode instead.')
46+
47+
case Plugin.settings.mode
48+
when :ssh
49+
Plugin.logger.warn('Deprecated option async_ssh used together with ssh mode, switching mode to ssh-async.')
50+
Plugin.settings.mode = :'ssh-async'
51+
when :'async-ssh'
52+
# This is a noop
53+
else
54+
Plugin.logger.warn('Deprecated option async_ssh used together with incompatible mode, ignoring.')
55+
end
56+
end
4357
end
4458

4559
def validate_mqtt_settings!

lib/smart_proxy_remote_execution_ssh/plugin.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ class Plugin < Proxy::Plugin
3535

3636
Proxy::RemoteExecution::Ssh.validate!
3737

38-
# TODO: Move into more native methods when available
39-
if settings.async_ssh
40-
logger.warn('Option async_ssh is deprecated, use ssh-async mode instead.')
41-
end
42-
4338
Proxy::Dynflow::TaskLauncherRegistry.register('ssh', Proxy::Dynflow::TaskLauncher::Batch)
4439
end
4540

0 commit comments

Comments
 (0)