opswalrus 1.0.87 → 1.0.89
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/app.rb +11 -2
- data/lib/opswalrus/host.rb +1 -0
- data/lib/opswalrus/operation_runner.rb +3 -2
- data/lib/opswalrus/sshkit_ext.rb +2 -0
- data/lib/opswalrus/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea3eb2c025307f4caf46517d31cc699e129f11a1f5af9ab031a17813f54478cb
|
4
|
+
data.tar.gz: 22d758a1ac797784030ef99dea7f16cb042060d90a20d826b3d999a0276030fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 335f860e454819af1e4741a06d936a8b2e8b1ab66faf3504b1b064801b3ecd267a1f8034d56ed2a5188b2a560174fcf266c30c510ed5dee20000fa4b230ee337
|
7
|
+
data.tar.gz: 82d39a23be2b270400b7f5207570d73d7b8952c1305e214ce38dd5dec3f2084817a96cced59d0d017cdd0334f8748b9c06a0dd359098725238779f4038cafd5a
|
data/Gemfile.lock
CHANGED
data/lib/opswalrus/app.rb
CHANGED
@@ -316,10 +316,19 @@ module OpsWalrus
|
|
316
316
|
SemanticLogger.flush
|
317
317
|
output = StringIO.open do |io|
|
318
318
|
io.puts SCRIPT_RESULT_HEADER
|
319
|
-
|
319
|
+
obj = case result
|
320
|
+
when Invocation::Success
|
321
|
+
result.value
|
322
|
+
when Invocation::Error
|
323
|
+
{
|
324
|
+
error_type: result.value.class,
|
325
|
+
error: result.value,
|
326
|
+
}
|
327
|
+
end
|
328
|
+
io.puts JSON.pretty_generate(obj)
|
320
329
|
io.string
|
321
330
|
end
|
322
|
-
puts "print_script_result - #{Time.now}"
|
331
|
+
# puts "print_script_result - #{Time.now.strftime('%s%L')}"
|
323
332
|
puts output
|
324
333
|
end
|
325
334
|
end
|
data/lib/opswalrus/host.rb
CHANGED
@@ -578,6 +578,7 @@ module OpsWalrus
|
|
578
578
|
end
|
579
579
|
end
|
580
580
|
|
581
|
+
# Returns a SSHKit::Command
|
581
582
|
def execute_cmd(*args, input_mapping: nil, ops_prompt_for_sudo_password: false)
|
582
583
|
# we only want one of the sudo password interaction handlers:
|
583
584
|
# if we're running an ops script on the remote host and we've passed the --pass flag in our invocation of the ops command on the remote host,
|
@@ -87,14 +87,15 @@ module OpsWalrus
|
|
87
87
|
end
|
88
88
|
rescue SSHKit::Command::Failed => e
|
89
89
|
App.instance.error "[!] Command failed: #{e.message}"
|
90
|
+
Invocation::Error.new(e)
|
90
91
|
rescue Error => e
|
91
|
-
puts "OperationRunner#run - #{Time.now}"
|
92
|
+
# puts "OperationRunner#run - #{Time.now.strftime('%s%L')}"
|
92
93
|
App.instance.error "Error: Ops script crashed."
|
93
94
|
App.instance.error e.message
|
94
95
|
App.instance.error e.backtrace.take(10).join("\n")
|
95
96
|
Invocation::Error.new(e)
|
96
97
|
rescue => e
|
97
|
-
puts "OperationRunner#run - #{Time.now}"
|
98
|
+
# puts "OperationRunner#run - #{Time.now.strftime('%s%L')}"
|
98
99
|
App.instance.error "Unhandled Error: Ops script crashed."
|
99
100
|
App.instance.error e.class
|
100
101
|
App.instance.error e.message
|
data/lib/opswalrus/sshkit_ext.rb
CHANGED
@@ -14,11 +14,13 @@ module SSHKit
|
|
14
14
|
|
15
15
|
module Backend
|
16
16
|
class Abstract
|
17
|
+
# Returns a SSHKit::Command
|
17
18
|
# def execute(*args)
|
18
19
|
# options = { verbosity: :debug, raise_on_non_zero_exit: false }.merge(args.extract_options!)
|
19
20
|
# create_command_and_execute(args, options).success?
|
20
21
|
# end
|
21
22
|
|
23
|
+
# Returns a SSHKit::Command
|
22
24
|
def execute_cmd(*args)
|
23
25
|
options = { verbosity: :info, strip: true, raise_on_non_zero_exit: false }.merge(args.extract_options!)
|
24
26
|
create_command_and_execute(args, options)
|
data/lib/opswalrus/version.rb
CHANGED