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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23ccee9336c9eeffa5c8bf4fd9c4f26353eb49fada6d7643ad236b81f5ad4061
4
- data.tar.gz: b43f9ee85f5557c60506d74a9a21d7d31d21762a47449bed8fa6a145cc05f8eb
3
+ metadata.gz: d6e2b6b9ba0610010ba57293457a77331d9c9a93f7b692d47876df0646c5d68f
4
+ data.tar.gz: 10bcd65544195a67259995a95485bf55cc851710665810365d823bfa6ea473c5
5
5
  SHA512:
6
- metadata.gz: 2f172ded5af3368a410705b17ea624da8ab0f994d84a2441a403066af0a4b56010345bee5437b9eac8d2cc883644d4febc479d666a4a5b4309efe6ce841d22f9
7
- data.tar.gz: 4022b1f2bf0aadbd83067798639f6ac593228f9d54cc3f79e0df3dee5172069a59ce72421f569a140ee31b1f382724435482c7860bcf8eb02d783150ab37e78e
6
+ metadata.gz: 9e8856211f18735ad966a78d6078a361071a5e352e4184ffba04d9cfc05944040f2a2a059760d013c285dccc37ef9735fe6951cf6d175795076c1a60f6205da1
7
+ data.tar.gz: d011ec4eb7311e1a76c625e3156c36652cf23abfee071d5fb1b3dffffde7e8c92ec0d1442e229d804375390c99eaafe442e12f170b69161d75bddb0b272468a5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- opswalrus (1.0.62)
4
+ opswalrus (1.0.63)
5
5
  activesupport (~> 7.0)
6
6
  bcrypt_pbkdf (~> 1.1)
7
7
  binding_of_caller (~> 1.0)
@@ -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
@@ -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(/^#{::OpsWalrus::App::SCRIPT_RESULT_HEADER}$/)
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})"
@@ -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
- retval = if ops_command_options.empty?
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
- retval
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
- retval = if ops_command_options.empty?
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
- retval
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
@@ -1,3 +1,3 @@
1
1
  module OpsWalrus
2
- VERSION = "1.0.62"
2
+ VERSION = "1.0.63"
3
3
  end
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.62
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-25 00:00:00.000000000 Z
11
+ date: 2023-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport