opswalrus 1.0.88 → 1.0.90
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 +12 -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: be30907e45b6057c4144c751d217cbf29257467a43a774bb8af77aa3800e57ee
|
4
|
+
data.tar.gz: 64cf47f93ca059c651a7d7d18d2ce413ff777f9227919010113775bfbf19abe4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99e694d84109d972405d1a261db3a87c20c1bf5c61ea1fb02404602f4010e4e0b5fa7ff48f891ae4951aabfd835034f26d491413c3a8866a5b87dd2e15d269f9
|
7
|
+
data.tar.gz: bb839633cd249d2d4144c63665035b56800014563fef80db45f38a15952f872dca6e8a3925c39be4759964d9d31fcb36a2e22f5d3994cc39dcc11b3db2080451
|
data/Gemfile.lock
CHANGED
data/lib/opswalrus/app.rb
CHANGED
@@ -316,10 +316,20 @@ 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
|
+
backtrace: result.value.backtrace.take(10).join("\n")
|
327
|
+
}
|
328
|
+
end
|
329
|
+
io.puts JSON.pretty_generate(obj)
|
320
330
|
io.string
|
321
331
|
end
|
322
|
-
puts "print_script_result - #{Time.now.strftime('%s%L')}"
|
332
|
+
# puts "print_script_result - #{Time.now.strftime('%s%L')}"
|
323
333
|
puts output
|
324
334
|
end
|
325
335
|
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.strftime('%s%L')}"
|
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.strftime('%s%L')}"
|
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