tomo 1.18.3 → 1.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/tomo +1 -0
- data/lib/tomo/cli/command.rb +4 -2
- data/lib/tomo/cli/common_options.rb +2 -0
- data/lib/tomo/cli/completions.rb +3 -1
- data/lib/tomo/cli/deploy_options.rb +2 -0
- data/lib/tomo/cli/error.rb +2 -0
- data/lib/tomo/cli/interrupted_error.rb +2 -0
- data/lib/tomo/cli/options.rb +2 -0
- data/lib/tomo/cli/parser.rb +3 -1
- data/lib/tomo/cli/project_options.rb +2 -0
- data/lib/tomo/cli/rules/argument.rb +2 -0
- data/lib/tomo/cli/rules/switch.rb +2 -0
- data/lib/tomo/cli/rules/value_switch.rb +3 -1
- data/lib/tomo/cli/rules.rb +8 -6
- data/lib/tomo/cli/rules_evaluator.rb +6 -4
- data/lib/tomo/cli/state.rb +2 -0
- data/lib/tomo/cli/usage.rb +2 -0
- data/lib/tomo/cli.rb +2 -0
- data/lib/tomo/colors.rb +2 -0
- data/lib/tomo/commands/completion_script.rb +2 -0
- data/lib/tomo/commands/default.rb +2 -0
- data/lib/tomo/commands/deploy.rb +2 -0
- data/lib/tomo/commands/help.rb +2 -0
- data/lib/tomo/commands/init.rb +2 -0
- data/lib/tomo/commands/run.rb +2 -0
- data/lib/tomo/commands/setup.rb +2 -0
- data/lib/tomo/commands/tasks.rb +2 -0
- data/lib/tomo/commands/version.rb +2 -0
- data/lib/tomo/commands.rb +2 -0
- data/lib/tomo/configuration/dsl/batch_block.rb +3 -1
- data/lib/tomo/configuration/dsl/config_file.rb +8 -6
- data/lib/tomo/configuration/dsl/environment_block.rb +2 -0
- data/lib/tomo/configuration/dsl/error_formatter.rb +3 -1
- data/lib/tomo/configuration/dsl/hosts_and_settings.rb +6 -4
- data/lib/tomo/configuration/dsl/tasks_block.rb +5 -3
- data/lib/tomo/configuration/dsl.rb +2 -0
- data/lib/tomo/configuration/environment.rb +2 -0
- data/lib/tomo/configuration/glob.rb +2 -0
- data/lib/tomo/configuration/plugin_file_not_found_error.rb +2 -0
- data/lib/tomo/configuration/plugins_registry/file_resolver.rb +3 -1
- data/lib/tomo/configuration/plugins_registry/gem_resolver.rb +4 -2
- data/lib/tomo/configuration/plugins_registry.rb +2 -0
- data/lib/tomo/configuration/project_not_found_error.rb +2 -0
- data/lib/tomo/configuration/role_based_task_filter.rb +2 -0
- data/lib/tomo/configuration/unknown_environment_error.rb +4 -2
- data/lib/tomo/configuration/unknown_plugin_error.rb +4 -2
- data/lib/tomo/configuration/unspecified_environment_error.rb +2 -0
- data/lib/tomo/configuration.rb +7 -5
- data/lib/tomo/console/key_reader.rb +4 -2
- data/lib/tomo/console/menu.rb +6 -4
- data/lib/tomo/console/non_interactive_error.rb +4 -2
- data/lib/tomo/console.rb +3 -1
- data/lib/tomo/error/suggestions.rb +3 -1
- data/lib/tomo/error.rb +2 -0
- data/lib/tomo/host.rb +4 -2
- data/lib/tomo/logger/tagged_io.rb +2 -0
- data/lib/tomo/logger.rb +2 -0
- data/lib/tomo/path.rb +2 -0
- data/lib/tomo/paths.rb +2 -0
- data/lib/tomo/plugin/bundler/helpers.rb +2 -0
- data/lib/tomo/plugin/bundler/tasks.rb +2 -0
- data/lib/tomo/plugin/bundler.rb +2 -0
- data/lib/tomo/plugin/core/helpers.rb +2 -0
- data/lib/tomo/plugin/core/tasks.rb +2 -0
- data/lib/tomo/plugin/core.rb +2 -0
- data/lib/tomo/plugin/env/tasks.rb +17 -6
- data/lib/tomo/plugin/env.rb +2 -0
- data/lib/tomo/plugin/git/helpers.rb +2 -0
- data/lib/tomo/plugin/git/tasks.rb +2 -0
- data/lib/tomo/plugin/git.rb +2 -0
- data/lib/tomo/plugin/nodenv/tasks.rb +2 -0
- data/lib/tomo/plugin/nodenv.rb +2 -0
- data/lib/tomo/plugin/puma/tasks.rb +2 -0
- data/lib/tomo/plugin/puma.rb +2 -0
- data/lib/tomo/plugin/rails/helpers.rb +2 -0
- data/lib/tomo/plugin/rails/tasks.rb +2 -0
- data/lib/tomo/plugin/rails.rb +2 -0
- data/lib/tomo/plugin/rbenv/tasks.rb +3 -1
- data/lib/tomo/plugin/rbenv.rb +2 -0
- data/lib/tomo/plugin/testing.rb +2 -0
- data/lib/tomo/plugin.rb +2 -0
- data/lib/tomo/plugin_dsl.rb +2 -0
- data/lib/tomo/remote.rb +5 -3
- data/lib/tomo/result.rb +3 -1
- data/lib/tomo/runtime/concurrent_ruby_load_error.rb +2 -0
- data/lib/tomo/runtime/concurrent_ruby_thread_pool.rb +2 -0
- data/lib/tomo/runtime/context.rb +2 -0
- data/lib/tomo/runtime/current.rb +2 -0
- data/lib/tomo/runtime/execution_plan.rb +4 -2
- data/lib/tomo/runtime/explanation.rb +3 -1
- data/lib/tomo/runtime/host_execution_step.rb +3 -1
- data/lib/tomo/runtime/inline_thread_pool.rb +2 -0
- data/lib/tomo/runtime/no_tasks_error.rb +2 -0
- data/lib/tomo/runtime/privileged_task.rb +2 -0
- data/lib/tomo/runtime/settings_interpolation.rb +3 -1
- data/lib/tomo/runtime/settings_required_error.rb +3 -1
- data/lib/tomo/runtime/task_aborted_error.rb +2 -0
- data/lib/tomo/runtime/task_runner.rb +5 -3
- data/lib/tomo/runtime/template_not_found_error.rb +2 -0
- data/lib/tomo/runtime/unknown_task_error.rb +3 -1
- data/lib/tomo/runtime.rb +8 -6
- data/lib/tomo/script.rb +2 -0
- data/lib/tomo/shell_builder.rb +2 -0
- data/lib/tomo/ssh/child_process.rb +4 -2
- data/lib/tomo/ssh/connection.rb +4 -2
- data/lib/tomo/ssh/connection_error.rb +2 -0
- data/lib/tomo/ssh/connection_validator.rb +8 -6
- data/lib/tomo/ssh/error.rb +2 -0
- data/lib/tomo/ssh/executable_error.rb +2 -0
- data/lib/tomo/ssh/options.rb +4 -2
- data/lib/tomo/ssh/permission_error.rb +2 -0
- data/lib/tomo/ssh/script_error.rb +2 -0
- data/lib/tomo/ssh/unknown_error.rb +2 -0
- data/lib/tomo/ssh/unsupported_version_error.rb +2 -0
- data/lib/tomo/ssh.rb +2 -0
- data/lib/tomo/task_api.rb +3 -1
- data/lib/tomo/task_library.rb +2 -0
- data/lib/tomo/templates/config.rb.erb +1 -4
- data/lib/tomo/testing/Dockerfile +1 -1
- data/lib/tomo/testing/cli_extensions.rb +2 -0
- data/lib/tomo/testing/cli_tester.rb +4 -2
- data/lib/tomo/testing/connection.rb +2 -0
- data/lib/tomo/testing/docker_image.rb +4 -2
- data/lib/tomo/testing/host_extensions.rb +3 -1
- data/lib/tomo/testing/local.rb +14 -12
- data/lib/tomo/testing/log_capturing.rb +2 -0
- data/lib/tomo/testing/mock_plugin_tester.rb +2 -0
- data/lib/tomo/testing/mocked_exec_error.rb +2 -0
- data/lib/tomo/testing/mocked_exit_error.rb +2 -0
- data/lib/tomo/testing/remote_extensions.rb +2 -0
- data/lib/tomo/testing/ssh_extensions.rb +2 -0
- data/lib/tomo/testing/systemctl.rb +1 -0
- data/lib/tomo/testing/ubuntu_setup.sh +3 -1
- data/lib/tomo/testing.rb +2 -0
- data/lib/tomo/version.rb +3 -1
- data/lib/tomo.rb +3 -1
- metadata +4 -4
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tomo
|
2
4
|
class Console
|
3
5
|
class NonInteractiveError < Tomo::Error
|
@@ -5,8 +7,8 @@ module Tomo
|
|
5
7
|
|
6
8
|
def to_console
|
7
9
|
error = ""
|
8
|
-
error
|
9
|
-
error
|
10
|
+
error += "#{operation_name} requires an interactive console."
|
11
|
+
error += "\n\n#{seems_like_ci}" if ci_var
|
10
12
|
error
|
11
13
|
end
|
12
14
|
|
data/lib/tomo/console.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "forwardable"
|
2
4
|
require "io/console"
|
3
5
|
|
@@ -56,7 +58,7 @@ module Tomo
|
|
56
58
|
private_constant :CI_VARS
|
57
59
|
|
58
60
|
def ci?
|
59
|
-
|
61
|
+
env.keys.intersect?(CI_VARS)
|
60
62
|
end
|
61
63
|
|
62
64
|
def assert_interactive
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tomo
|
2
4
|
class Error
|
3
5
|
class Suggestions
|
@@ -12,7 +14,7 @@ module Tomo
|
|
12
14
|
|
13
15
|
def to_a
|
14
16
|
@_suggestions ||= if defined?(DidYouMean::SpellChecker)
|
15
|
-
checker = DidYouMean::SpellChecker.new(dictionary:
|
17
|
+
checker = DidYouMean::SpellChecker.new(dictionary:)
|
16
18
|
suggestions = checker.correct(word)
|
17
19
|
suggestions || []
|
18
20
|
else
|
data/lib/tomo/error.rb
CHANGED
data/lib/tomo/host.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tomo
|
2
4
|
class Host
|
3
5
|
PATTERN = /^(?:(\S+)@)?(\S*?)$/
|
@@ -10,7 +12,7 @@ module Tomo
|
|
10
12
|
user, address = host.match(PATTERN).captures
|
11
13
|
raise ArgumentError, "host cannot be blank" if address.empty?
|
12
14
|
|
13
|
-
new(user
|
15
|
+
new(user:, address:, **kwargs)
|
14
16
|
end
|
15
17
|
|
16
18
|
def initialize(address:, port: nil, log_prefix: nil, roles: nil, user: nil, privileged_user: "root")
|
@@ -31,7 +33,7 @@ module Tomo
|
|
31
33
|
|
32
34
|
def to_s
|
33
35
|
str = user ? "#{user}@#{address}" : address
|
34
|
-
str
|
36
|
+
str += ":#{port}" unless port == 22
|
35
37
|
str
|
36
38
|
end
|
37
39
|
|
data/lib/tomo/logger.rb
CHANGED
data/lib/tomo/path.rb
CHANGED
data/lib/tomo/paths.rb
CHANGED
data/lib/tomo/plugin/bundler.rb
CHANGED
data/lib/tomo/plugin/core.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "monitor"
|
4
|
+
require "securerandom"
|
2
5
|
|
3
6
|
module Tomo::Plugin::Env
|
4
7
|
class Tasks < Tomo::TaskLibrary # rubocop:disable Metrics/ClassLength
|
@@ -14,17 +17,25 @@ module Tomo::Plugin::Env
|
|
14
17
|
update
|
15
18
|
end
|
16
19
|
|
17
|
-
def update
|
20
|
+
def update # rubocop:disable Metrics/MethodLength
|
18
21
|
return if settings[:env_vars].empty?
|
19
22
|
|
20
23
|
modify_env_file do |env|
|
21
24
|
settings[:env_vars].each do |name, value|
|
22
|
-
|
25
|
+
case value
|
26
|
+
when :prompt
|
27
|
+
next if contains_entry?(env, name)
|
28
|
+
|
29
|
+
value = prompt_for(name, message: <<~MSG)
|
30
|
+
The remote host needs a value for the $#{name} environment variable.
|
31
|
+
Please provide a value at the prompt.
|
32
|
+
MSG
|
33
|
+
when :generate_secret
|
34
|
+
next if contains_entry?(env, name)
|
35
|
+
|
36
|
+
value = SecureRandom.hex(64)
|
37
|
+
end
|
23
38
|
|
24
|
-
value = prompt_for(name, message: <<~MSG) if value == :prompt
|
25
|
-
The remote host needs a value for the $#{name} environment variable.
|
26
|
-
Please provide a value at the prompt.
|
27
|
-
MSG
|
28
39
|
replace_entry(env, name, value)
|
29
40
|
end
|
30
41
|
end
|
data/lib/tomo/plugin/env.rb
CHANGED
data/lib/tomo/plugin/git.rb
CHANGED
data/lib/tomo/plugin/nodenv.rb
CHANGED
data/lib/tomo/plugin/puma.rb
CHANGED
data/lib/tomo/plugin/rails.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "shellwords"
|
2
4
|
|
3
5
|
module Tomo::Plugin::Rbenv
|
@@ -19,7 +21,7 @@ module Tomo::Plugin::Rbenv
|
|
19
21
|
|
20
22
|
def modify_bashrc
|
21
23
|
existing_rc = remote.capture("cat", paths.bashrc, raise_on_error: false)
|
22
|
-
return if existing_rc.include?("rbenv init")
|
24
|
+
return if existing_rc.include?("rbenv init") && existing_rc.include?("$HOME/.rbenv/bin")
|
23
25
|
|
24
26
|
remote.write(text: <<~BASHRC + existing_rc, to: paths.bashrc)
|
25
27
|
if [ -d $HOME/.rbenv ]; then
|
data/lib/tomo/plugin/rbenv.rb
CHANGED
data/lib/tomo/plugin/testing.rb
CHANGED
data/lib/tomo/plugin.rb
CHANGED
data/lib/tomo/plugin_dsl.rb
CHANGED
data/lib/tomo/remote.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "forwardable"
|
2
4
|
|
3
5
|
module Tomo
|
@@ -20,14 +22,14 @@ module Tomo
|
|
20
22
|
end
|
21
23
|
|
22
24
|
def attach(*command, default_chdir: nil, **command_opts)
|
23
|
-
full_command = shell_builder.build(*command, default_chdir:
|
25
|
+
full_command = shell_builder.build(*command, default_chdir:)
|
24
26
|
ssh.ssh_exec(Script.new(full_command, pty: true, **command_opts))
|
25
27
|
end
|
26
28
|
|
27
29
|
def run(*command, attach: false, default_chdir: nil, **command_opts)
|
28
|
-
attach(*command, default_chdir
|
30
|
+
attach(*command, default_chdir:, **command_opts) if attach
|
29
31
|
|
30
|
-
full_command = shell_builder.build(*command, default_chdir:
|
32
|
+
full_command = shell_builder.build(*command, default_chdir:)
|
31
33
|
ssh.ssh_subprocess(Script.new(full_command, **command_opts))
|
32
34
|
end
|
33
35
|
|
data/lib/tomo/result.rb
CHANGED
data/lib/tomo/runtime/context.rb
CHANGED
data/lib/tomo/runtime/current.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "forwardable"
|
2
4
|
|
3
5
|
module Tomo
|
@@ -35,7 +37,7 @@ module Tomo
|
|
35
37
|
open_connections do |remotes|
|
36
38
|
plan.each do |steps|
|
37
39
|
steps.each do |step|
|
38
|
-
step.execute(thread_pool
|
40
|
+
step.execute(thread_pool:, remotes:)
|
39
41
|
end
|
40
42
|
thread_pool.run_to_completion
|
41
43
|
end
|
@@ -76,7 +78,7 @@ module Tomo
|
|
76
78
|
def build_plan(tasks, task_filter)
|
77
79
|
tasks.each_with_object([]) do |task, result|
|
78
80
|
steps = hosts.map do |host|
|
79
|
-
HostExecutionStep.new(tasks: task, host
|
81
|
+
HostExecutionStep.new(tasks: task, host:, task_filter:, task_runner:)
|
80
82
|
end
|
81
83
|
steps.reject!(&:empty?)
|
82
84
|
result << steps unless steps.empty?
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tomo
|
2
4
|
class Runtime
|
3
5
|
class Explanation
|
@@ -22,7 +24,7 @@ module Tomo
|
|
22
24
|
indent = threads > 1 ? " = " : ""
|
23
25
|
if threads > 1 && step.applicable_tasks.length > 1
|
24
26
|
desc << "#{indent}IN SEQUENCE:"
|
25
|
-
indent.sub
|
27
|
+
indent = indent.sub("=", " ")
|
26
28
|
end
|
27
29
|
desc << step.explain.gsub(/^/, indent)
|
28
30
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tomo
|
2
4
|
class Runtime
|
3
5
|
class HostExecutionStep
|
@@ -25,7 +27,7 @@ module Tomo
|
|
25
27
|
|
26
28
|
task_host = task.is_a?(PrivilegedTask) ? host.as_privileged : host
|
27
29
|
remote = remotes[task_host]
|
28
|
-
task_runner.run(task
|
30
|
+
task_runner.run(task:, remote:)
|
29
31
|
end
|
30
32
|
end
|
31
33
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tomo
|
2
4
|
class Runtime
|
3
5
|
class SettingsInterpolation
|
@@ -40,7 +42,7 @@ module Tomo
|
|
40
42
|
|
41
43
|
def dump_settings(hash)
|
42
44
|
key_len = hash.keys.map { |k| k.to_s.length }.max
|
43
|
-
dump = "Settings: {\n"
|
45
|
+
dump = +"Settings: {\n"
|
44
46
|
hash.to_a.sort_by(&:first).each do |key, value|
|
45
47
|
justified_key = "#{key}:".ljust(key_len + 1)
|
46
48
|
dump << " #{justified_key} #{value.inspect},\n"
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tomo
|
2
4
|
class Runtime
|
3
5
|
class SettingsRequiredError < Tomo::Error
|
@@ -24,7 +26,7 @@ module Tomo
|
|
24
26
|
return "a value for the #{yellow(settings.first.to_s)} setting." if settings.length == 1
|
25
27
|
|
26
28
|
sentence = "values for these settings:\n\n "
|
27
|
-
sentence
|
29
|
+
sentence + settings.map { |s| yellow(s.to_s) }.join("\n ")
|
28
30
|
end
|
29
31
|
end
|
30
32
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tomo
|
2
4
|
class Runtime
|
3
5
|
class TaskRunner
|
@@ -24,15 +26,15 @@ module Tomo
|
|
24
26
|
|
25
27
|
def run(task:, remote:)
|
26
28
|
validate_task!(task)
|
27
|
-
Current.with(task
|
29
|
+
Current.with(task:, remote:) do
|
28
30
|
Tomo.logger.task_start(task)
|
29
31
|
tasks_by_name[task].call
|
30
32
|
end
|
31
33
|
end
|
32
34
|
|
33
35
|
def connect(host)
|
34
|
-
Current.with(host:
|
35
|
-
conn = SSH.connect(host
|
36
|
+
Current.with(host:) do
|
37
|
+
conn = SSH.connect(host:, options: ssh_options)
|
36
38
|
remote = Remote.new(conn, context, helper_modules)
|
37
39
|
return remote unless block_given?
|
38
40
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tomo
|
2
4
|
class Runtime
|
3
5
|
class UnknownTaskError < Error
|
@@ -10,7 +12,7 @@ module Tomo
|
|
10
12
|
ERROR
|
11
13
|
|
12
14
|
sugg = spelling_suggestion || missing_plugin_suggestion
|
13
|
-
error
|
15
|
+
error += sugg if sugg
|
14
16
|
error
|
15
17
|
end
|
16
18
|
|
data/lib/tomo/runtime.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "time"
|
2
4
|
|
3
5
|
module Tomo
|
@@ -51,15 +53,15 @@ module Tomo
|
|
51
53
|
end
|
52
54
|
|
53
55
|
def run!(task, *args, privileged: false)
|
54
|
-
task = task.
|
55
|
-
execution_plan_for([task], release: :current, args:
|
56
|
+
task = String.new(task).extend(PrivilegedTask) if privileged
|
57
|
+
execution_plan_for([task], release: :current, args:).execute
|
56
58
|
end
|
57
59
|
|
58
60
|
def execution_plan_for(tasks, release: :current, args: [])
|
59
61
|
ExecutionPlan.new(
|
60
|
-
tasks
|
61
|
-
hosts
|
62
|
-
task_filter
|
62
|
+
tasks:,
|
63
|
+
hosts:,
|
64
|
+
task_filter:,
|
63
65
|
task_runner: new_task_runner(release, args)
|
64
66
|
)
|
65
67
|
end
|
@@ -74,7 +76,7 @@ module Tomo
|
|
74
76
|
.merge(settings)
|
75
77
|
.merge(run_args: args)
|
76
78
|
|
77
|
-
TaskRunner.new(plugins_registry
|
79
|
+
TaskRunner.new(plugins_registry:, settings: run_settings)
|
78
80
|
end
|
79
81
|
|
80
82
|
def release_path_for(type)
|
data/lib/tomo/script.rb
CHANGED
data/lib/tomo/shell_builder.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "open3"
|
2
4
|
require "shellwords"
|
3
5
|
require "stringio"
|
@@ -6,7 +8,7 @@ module Tomo
|
|
6
8
|
module SSH
|
7
9
|
class ChildProcess
|
8
10
|
def self.execute(*command, on_data: ->(data) {})
|
9
|
-
process = new(*command, on_data:
|
11
|
+
process = new(*command, on_data:)
|
10
12
|
process.wait_for_exit
|
11
13
|
process.result
|
12
14
|
end
|
@@ -31,7 +33,7 @@ module Tomo
|
|
31
33
|
end
|
32
34
|
|
33
35
|
def result
|
34
|
-
Result.new(exit_status
|
36
|
+
Result.new(exit_status:, stdout: stdout_buffer.string, stderr: stderr_buffer.string)
|
35
37
|
end
|
36
38
|
|
37
39
|
private
|
data/lib/tomo/ssh/connection.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "fileutils"
|
2
4
|
require "securerandom"
|
3
5
|
require "tmpdir"
|
@@ -26,7 +28,7 @@ module Tomo
|
|
26
28
|
end
|
27
29
|
|
28
30
|
def ssh_subprocess(script, verbose: false)
|
29
|
-
ssh_args = build_args(script, verbose:
|
31
|
+
ssh_args = build_args(script, verbose:)
|
30
32
|
handle_data = ->(data) { logger.script_output(script, data) }
|
31
33
|
|
32
34
|
logger.script_start(script)
|
@@ -62,7 +64,7 @@ module Tomo
|
|
62
64
|
end
|
63
65
|
|
64
66
|
def raise_run_error(script, ssh_args, result)
|
65
|
-
ScriptError.raise_with(result.output, host
|
67
|
+
ScriptError.raise_with(result.output, host:, result:, script:, ssh_args:)
|
66
68
|
end
|
67
69
|
end
|
68
70
|
end
|