opswalrus 1.0.62 → 1.0.63
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/opswalrus/_run_remote.ops +0 -1
- data/lib/opswalrus/host.rb +5 -1
- data/lib/opswalrus/invocation.rb +10 -4
- data/lib/opswalrus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6e2b6b9ba0610010ba57293457a77331d9c9a93f7b692d47876df0646c5d68f
|
4
|
+
data.tar.gz: 10bcd65544195a67259995a95485bf55cc851710665810365d823bfa6ea473c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e8856211f18735ad966a78d6078a361071a5e352e4184ffba04d9cfc05944040f2a2a059760d013c285dccc37ef9735fe6951cf6d175795076c1a60f6205da1
|
7
|
+
data.tar.gz: d011ec4eb7311e1a76c625e3156c36652cf23abfee071d5fb1b3dffffde7e8c92ec0d1442e229d804375390c99eaafe442e12f170b69161d75bddb0b272468a5
|
data/Gemfile.lock
CHANGED
@@ -6,6 +6,5 @@ ssh in: :sequence do
|
|
6
6
|
# ssh_noprep do
|
7
7
|
# puts params.stringify_keys!
|
8
8
|
# desc "Running `#{params.ops_file.ops_file_path} #{params.operation_kv_args.join(' ')}` on #{to_s} (alias=#{self.alias})"
|
9
|
-
# run_ops(ops_command, ops_command_options = nil, command_arguments, in_bundle_root_dir: true, ops_prompt_for_sudo_password: false)
|
10
9
|
_invoke_remote(params.ops_file, *params.operation_kv_args)
|
11
10
|
end
|
data/lib/opswalrus/host.rb
CHANGED
@@ -322,21 +322,25 @@ module OpsWalrus
|
|
322
322
|
end
|
323
323
|
|
324
324
|
def parse_stdout_and_script_return_value(command_output)
|
325
|
-
output_sections = command_output.split(
|
325
|
+
output_sections = command_output.split(/#{::OpsWalrus::App::SCRIPT_RESULT_HEADER}/)
|
326
326
|
case output_sections.count
|
327
327
|
when 1
|
328
328
|
stdout, ops_script_retval = output_sections.first, nil
|
329
|
+
# puts "found it1!: #{output_sections.inspect}"
|
329
330
|
when 2
|
330
331
|
stdout, ops_script_retval = *output_sections
|
332
|
+
# puts "found it2!: #{ops_script_retval}"
|
331
333
|
else
|
332
334
|
# this is unexpected
|
333
335
|
ops_script_retval = output_sections.pop
|
334
336
|
stdout = output_sections.join(::OpsWalrus::App::SCRIPT_RESULT_HEADER)
|
337
|
+
# puts "found it3!: #{ops_script_retval}"
|
335
338
|
end
|
336
339
|
[stdout, ops_script_retval]
|
337
340
|
end
|
338
341
|
|
339
342
|
# runs the specified ops command with the specified command arguments
|
343
|
+
# returns [stdout, stderr, exit_status]
|
340
344
|
def run_ops(ops_command, ops_command_options = nil, command_arguments, in_bundle_root_dir: true, ops_prompt_for_sudo_password: false)
|
341
345
|
local_hostname_for_remote_host = if self.alias
|
342
346
|
"#{host} (#{self.alias})"
|
data/lib/opswalrus/invocation.rb
CHANGED
@@ -125,13 +125,16 @@ module OpsWalrus
|
|
125
125
|
ops_command_options = "--script"
|
126
126
|
ops_command_options << " --pass" if @ops_prompt_for_sudo_password
|
127
127
|
ops_command_options << " --params #{remote_json_kwargs_tempfile_basename}" if remote_json_kwargs_tempfile_basename
|
128
|
-
|
128
|
+
|
129
|
+
output, stderr, exit_status = if ops_command_options.empty?
|
129
130
|
@host_proxy.run_ops(:run, remote_run_command_args, ops_prompt_for_sudo_password: @ops_prompt_for_sudo_password)
|
130
131
|
else
|
131
132
|
@host_proxy.run_ops(:run, ops_command_options, remote_run_command_args, ops_prompt_for_sudo_password: @ops_prompt_for_sudo_password)
|
132
133
|
end
|
133
134
|
|
134
|
-
|
135
|
+
App.instance.debug("Remote invocation failed:\n cmd: ops run #{ops_command_options.to_s} #{remote_run_command_args.to_s}\n stdout: #{output}\n") unless exit_status == 0
|
136
|
+
|
137
|
+
JSON.parse(output)
|
135
138
|
ensure
|
136
139
|
if json_kwargs_tempfile
|
137
140
|
json_kwargs_tempfile.close rescue nil
|
@@ -235,13 +238,16 @@ module OpsWalrus
|
|
235
238
|
ops_command_options = "--script"
|
236
239
|
ops_command_options << " --pass" if @ops_prompt_for_sudo_password
|
237
240
|
ops_command_options << " --params #{remote_json_kwargs_tempfile_basename}" if remote_json_kwargs_tempfile_basename
|
238
|
-
|
241
|
+
|
242
|
+
output, stderr, exit_status = if ops_command_options.empty?
|
239
243
|
@host_proxy.run_ops(:run, remote_run_command_args, ops_prompt_for_sudo_password: @ops_prompt_for_sudo_password)
|
240
244
|
else
|
241
245
|
@host_proxy.run_ops(:run, ops_command_options, remote_run_command_args, ops_prompt_for_sudo_password: @ops_prompt_for_sudo_password)
|
242
246
|
end
|
243
247
|
|
244
|
-
|
248
|
+
App.instance.debug("Remote invocation failed:\n cmd: ops run #{ops_command_options.to_s} #{remote_run_command_args.to_s}\n stdout: #{output}\n") unless exit_status == 0
|
249
|
+
|
250
|
+
JSON.parse(output)
|
245
251
|
ensure
|
246
252
|
if json_kwargs_tempfile
|
247
253
|
json_kwargs_tempfile.close rescue nil
|
data/lib/opswalrus/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opswalrus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.63
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Ellis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|