Skip to content

Commit 47f71ca

Browse files
committed
Make dynflow an explicit dependency
Loading the smart_proxy_dynflow (or any Smart Proxy plugin really) in load_classes does not work due to the way plugin initialization happens. For this plugin to work, dynflow must be running. This uses requires to validate that dynflow is actually correctly enabled and running. This also means that if dynflow was loaded but ended up in a failed state that REX SSH also ends up in a failed state.
1 parent a4e2ae3 commit 47f71ca

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/smart_proxy_remote_execution_ssh/plugin.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ class Plugin < Proxy::Plugin
6060

6161
plugin :ssh, Proxy::RemoteExecution::Ssh::VERSION
6262

63+
requires :dynflow, '~> 0.5'
64+
6365
load_classes do
6466
require 'smart_proxy_dynflow'
6567
require 'smart_proxy_dynflow/task_launcher'

test/integration_test.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ def test_features_for_default_mode_without_dynflow
2727

2828
mod = response['ssh']
2929
refute_nil(mod)
30-
assert_equal('running', mod['state'], Proxy::LogBuffer::Buffer.instance.info[:failed_modules][:ssh])
30+
assert_equal('failed', mod['state'], Proxy::LogBuffer::Buffer.instance.info[:failed_modules][:ssh])
31+
assert_equal("Disabling all modules in the group ['ssh'] due to a failure in one of them: 'dynflow' required by 'ssh' could not be found.",
32+
Proxy::LogBuffer::Buffer.instance.info[:failed_modules][:ssh])
3133
end
3234

3335
def test_features_for_default_mode_with_dynflow

0 commit comments

Comments
 (0)