opswalrus 1.0.96 → 1.0.97

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: 8fb52bd8ac55bffca7f34fc6213c004bc8ccc2e01d0e0682682ce077fe273bcb
4
- data.tar.gz: 4613f02bf1f7479eff1ab78ed2c407507f20bb546a8bd005dd469430e38b15ba
3
+ metadata.gz: ccf8e333c2a08306ce5afc14a557c69fe01d8681ffeb5e3957b80b09b68bcafa
4
+ data.tar.gz: b8d586b564c368d7e055746c515c7ea5883765b4a5ca3a9d389f89cd04e06e2c
5
5
  SHA512:
6
- metadata.gz: 901644932c68e186a15f94b77e179cf8412f9a791e7981fa79b0a4a035696c80e298aabf2a6ceb362dccec370ee2f63a6e174ffe31bb67c49966b7d296a32baf
7
- data.tar.gz: 3291a2be3c530e81bd6a0ad6706c4281de16df914d0d67aa8adc57b842e74c94305ae60c17c5556b06fe70ecc02ea19467cea323542fac9336ac43a813763abc
6
+ metadata.gz: 2d7a74e6e3872014452eaa8a19203e1da2b81c9af00c9a6e5f0499caff2a3309f18af2122e00097e7276d80bcd89fb937ab3de7e3b01373187611387e0e23b38
7
+ data.tar.gz: 5b24d54d03bbb5f9bdd03f2d5ddd1644f94819e54803b6d51f5812f5a8758c31f24a58b273c1d42600f00788c0b4e5777e8e3204a8c3a061e10e532c5a150ac9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- opswalrus (1.0.96)
4
+ opswalrus (1.0.97)
5
5
  activesupport (~> 7.0)
6
6
  bcrypt_pbkdf (~> 1.1)
7
7
  binding_of_caller (~> 1.0)
@@ -1,5 +1,7 @@
1
1
  # ssh_noprep in: :sequence do
2
- ssh_noprep do
2
+ host_to_value_map = ssh_noprep do
3
3
  puts "Bootstrapping #{to_s} (alias=#{self.alias})"
4
4
  _bootstrap_host(true)
5
5
  end
6
+
7
+ host_to_value_map.transform_keys(&:to_s)
@@ -10,7 +10,7 @@ timeout = params.timeout.integer!(default: 300)
10
10
 
11
11
  delay = 1 if delay < 1
12
12
 
13
- ssh_noprep in: :sequence do
13
+ host_to_value_map = ssh_noprep in: :sequence do
14
14
  # ssh_noprep do
15
15
 
16
16
  # survey of command options:
@@ -62,3 +62,5 @@ ssh_noprep in: :sequence do
62
62
  # }
63
63
  reboot(delay: delay, sync: sync, timeout: timeout)
64
64
  end
65
+
66
+ host_to_value_map.transform_keys(&:to_s)
@@ -2,9 +2,11 @@ params:
2
2
  ops_file: OpsFile
3
3
  operation_kv_args: array string
4
4
  ...
5
- ssh in: :sequence do
5
+ host_to_value_map = 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
9
  _invoke_remote(params.ops_file, *params.operation_kv_args)
10
10
  end
11
+
12
+ host_to_value_map.transform_keys(&:to_s)
@@ -1,9 +1,11 @@
1
1
  params:
2
2
  command: string
3
3
  ...
4
- ssh_noprep in: :sequence do
4
+ host_to_value_map = ssh_noprep in: :sequence do
5
5
  # ssh_noprep do
6
6
  command = params.command
7
7
  desc "Running `#{command}` on #{to_s} (alias=#{self.alias})"
8
8
  shell(command)
9
9
  end
10
+
11
+ host_to_value_map.transform_keys(&:to_s)
data/lib/opswalrus/app.rb CHANGED
@@ -231,7 +231,10 @@ module OpsWalrus
231
231
  result = op.run([], params_json_hash: params)
232
232
  # puts "result class=#{result.class}"
233
233
  exit_status = result.exit_status
234
- stdout = JSON.pretty_generate(result.value)
234
+ # when we are using the shell method
235
+ # puts result.value.class # EasyNavProxy
236
+ # puts result.value # Hash looking object
237
+ stdout = JSON.pretty_generate(result.value.to_h)
235
238
  output = if exit_status == 0
236
239
  Style.green(stdout)
237
240
  else
@@ -178,7 +178,7 @@ module OpsWalrus
178
178
  # 1. Net::SSH::Disconnect < Net::SSH::Exception with message: "connection closed by remote host"
179
179
  # 2. Errno::ECONNRESET < SystemCallError with message: "Connection reset by peer"
180
180
  # 3. Errno::ECONNREFUSED < SystemCallError with message: "Connection refused - connect(2) for 192.168.56.10:22"
181
- rescue Net::SSH::Disconnect, Errno::ECONNRESET, Errno::ECONNREFUSED => e
181
+ rescue Net::SSH::Disconnect, Net::SSH::ConnectionTimeout, Errno::ECONNRESET, Errno::ECONNREFUSED => e
182
182
  # noop; we expect these while we're trying to reconnect
183
183
  rescue => e
184
184
  puts "#{e.class} < #{e.class.superclass}"
@@ -118,6 +118,8 @@ module OpsWalrus
118
118
  App.instance.error "[!] The host '#{host}' doesn't accept password authentication method."
119
119
  rescue Errno::EHOSTUNREACH => e
120
120
  App.instance.error "[!] The host '#{host}' is unreachable"
121
+ rescue RemoteInvocationError => e
122
+ results[host] = e
121
123
  rescue => e
122
124
  App.instance.error e.class
123
125
  App.instance.error e.message
@@ -1,3 +1,3 @@
1
1
  module OpsWalrus
2
- VERSION = "1.0.96"
2
+ VERSION = "1.0.97"
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.96
4
+ version: 1.0.97
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-12-01 00:00:00.000000000 Z
11
+ date: 2023-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport