hybrid_platforms_conductor 32.8.0 → 32.8.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d9219641c19413d2e3a3eda578ab316036e4d2ea4825b27f398a66988fecc2c
|
4
|
+
data.tar.gz: 266d4ffd061d31e0c98eb29b7978b3eab070e282070300c49d66a09653637f50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: faf29c55e2f6d2938bdea2dd032558afd064a3be227a7aab4aa4e16ff9246e604795500e2adf9ba0847163c9e20931652e5545d68f82d4e96fcc2272e16b1bf1
|
7
|
+
data.tar.gz: dffe1ae884488901cce794c3c7be1237ea8a4832658dfa6a839fad0a19eeee17e7e3d7c5b0849381ffd2ae4a55e790a875b295f92bdf317d5f960ee5de60223a
|
@@ -505,16 +505,25 @@ module HybridPlatformsConductor
|
|
505
505
|
if @nodes_handler.get_ssh_session_exec_of(node) == 'false'
|
506
506
|
# Here we have to create a ControlMaster using an interactive session, as the SSH server prohibits ExecSession, and so command executions.
|
507
507
|
# We'll do that using another terminal spawned in the background.
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
508
|
+
if ENV['hpc_interactive'] == 'false'
|
509
|
+
error = "Can't spawn interactive ControlMaster to #{node} in non-interactive mode. You may want to change the hpc_interactive env variable."
|
510
|
+
if no_exception
|
511
|
+
log_error error
|
512
|
+
exit_status = :non_interactive
|
513
|
+
else
|
514
|
+
raise error
|
515
|
+
end
|
516
|
+
else
|
517
|
+
Thread.new do
|
518
|
+
log_debug "[ ControlMaster - #{ssh_url} ] - Spawn interactive ControlMaster in separate terminal"
|
519
|
+
@cmd_runner.run_cmd "xterm -e '#{ssh_exec} -o ControlMaster=yes -o ControlPersist=yes #{ssh_url}'", log_to_stdout: log_debug?
|
520
|
+
log_debug "[ ControlMaster - #{ssh_url} ] - Separate interactive ControlMaster closed"
|
521
|
+
end
|
522
|
+
out 'External ControlMaster has been spawned.'
|
523
|
+
out 'Please login into it, keep its session opened and press enter here when done...'
|
524
|
+
$stdin.gets
|
525
|
+
exit_status = 0
|
512
526
|
end
|
513
|
-
out 'External ControlMaster has been spawned.'
|
514
|
-
out 'Please login into it, keep its session opened and press enter here when done...'
|
515
|
-
raise "Can't spawn interactive ControlMaster to #{node} in non-interactive mode. You may want to change the hpc_interactive env variable." if ENV['hpc_interactive'] == 'false'
|
516
|
-
$stdin.gets
|
517
|
-
exit_status = 0
|
518
527
|
else
|
519
528
|
# Create the control master
|
520
529
|
ssh_control_master_start_cmd = "#{ssh_exec}#{@passwords.key?(node) || @auth_password ? '' : ' -o BatchMode=yes'} -o ControlMaster=yes -o ControlPersist=yes #{ssh_url} true"
|
data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/connections_spec.rb
CHANGED
@@ -53,9 +53,8 @@ describe HybridPlatformsConductor::ActionsExecutor do
|
|
53
53
|
['ssh -V 2>&1', proc { [0, "OpenSSH_7.4p1 Debian-10+deb9u7, OpenSSL 1.0.2u 20 Dec 2019\n", ''] }]
|
54
54
|
] + ssh_expected_commands_for(
|
55
55
|
{ 'node' => { connection: '192.168.42.42', user: 'test_user' } },
|
56
|
-
|
57
|
-
with_control_master_destroy: false
|
58
|
-
with_session_exec: false
|
56
|
+
with_control_master_create: false,
|
57
|
+
with_control_master_destroy: false
|
59
58
|
)
|
60
59
|
) do
|
61
60
|
test_connector.ssh_user = 'test_user'
|
@@ -67,6 +66,36 @@ describe HybridPlatformsConductor::ActionsExecutor do
|
|
67
66
|
end
|
68
67
|
end
|
69
68
|
|
69
|
+
it 'fails without creating exception when creating an SSH master to 1 node not having Session Exec capabilities when hpc_interactive is false and we use no_exception' do
|
70
|
+
with_test_platform(nodes: {
|
71
|
+
'node1' => { meta: { host_ip: '192.168.42.1' } },
|
72
|
+
'node2' => { meta: { host_ip: '192.168.42.2', ssh_session_exec: 'false' } },
|
73
|
+
'node3' => { meta: { host_ip: '192.168.42.3' } }
|
74
|
+
}) do
|
75
|
+
ENV['hpc_interactive'] = 'false'
|
76
|
+
with_cmd_runner_mocked(
|
77
|
+
[
|
78
|
+
['which env', proc { [0, "/usr/bin/env\n", ''] }],
|
79
|
+
['ssh -V 2>&1', proc { [0, "OpenSSH_7.4p1 Debian-10+deb9u7, OpenSSL 1.0.2u 20 Dec 2019\n", ''] }]
|
80
|
+
] + ssh_expected_commands_for(
|
81
|
+
'node1' => { connection: '192.168.42.1', user: 'test_user' },
|
82
|
+
'node3' => { connection: '192.168.42.3', user: 'test_user' }
|
83
|
+
) + ssh_expected_commands_for(
|
84
|
+
{
|
85
|
+
'node2' => { connection: '192.168.42.2', user: 'test_user' }
|
86
|
+
},
|
87
|
+
with_control_master_create: false,
|
88
|
+
with_control_master_destroy: false
|
89
|
+
)
|
90
|
+
) do
|
91
|
+
test_connector.ssh_user = 'test_user'
|
92
|
+
test_connector.with_connection_to(%w[node1 node2 node3], no_exception: true) do |connected_nodes|
|
93
|
+
expect(connected_nodes.sort).to eq %w[node1 node3].sort
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
70
99
|
it 'creates SSH master to several nodes' do
|
71
100
|
with_test_platform(nodes: {
|
72
101
|
'node1' => { meta: { host_ip: '192.168.42.1' } },
|