hotdog 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hotdog/commands/pssh.rb +23 -9
- data/lib/hotdog/commands/search.rb +4 -4
- data/lib/hotdog/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fbfa980ec0c4cb06df790c420adc03aafc5a71e
|
4
|
+
data.tar.gz: c348fd469bd7acc63c0e85ecd7e53db1c30d16d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef1af21553c95bc8cc2c9043441416fd4d167b2da04d0fadd724bd446f4633d248632cfd096d3349129815b9e654761dd08f2052a7d450bae8f1105f4c07566d
|
7
|
+
data.tar.gz: 457b99d664a0f96be234f52787b2d8343f3fad0bbb550196990a916433179718d57fb109915b2d076dc6c1367d956af29bfd7976171696cc98b513e6385dca51
|
data/lib/hotdog/commands/pssh.rb
CHANGED
@@ -10,26 +10,40 @@ module Hotdog
|
|
10
10
|
module Commands
|
11
11
|
class Pssh < SshAlike
|
12
12
|
def define_options(optparse, options={})
|
13
|
-
default_option(options, :show_identifier, true)
|
14
13
|
super
|
14
|
+
default_option(options, :show_identifier, true)
|
15
15
|
optparse.on("--[no-]identifier", "Each output line will be prepended with identifier.") do |identifier|
|
16
16
|
options[:show_identifier] = identifier
|
17
17
|
end
|
18
|
+
optparse.on("--stop-on-error", "Stop execution when a remote command fails (valid only if -P is set)") do |v|
|
19
|
+
options[:stop_on_error] = v
|
20
|
+
end
|
18
21
|
end
|
19
22
|
|
20
23
|
private
|
21
24
|
def run_main(hosts, options={})
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
begin
|
26
|
+
stats = Parallel.map(hosts.each_with_index.to_a, in_threads: parallelism(hosts)) { |host, i|
|
27
|
+
cmdline = build_command_string(host, @remote_command, options)
|
28
|
+
identifier = options[:show_identifier] ? host : nil
|
29
|
+
success = exec_command(identifier, cmdline, index: i, output: true)
|
30
|
+
if !success && options[:stop_on_error]
|
31
|
+
raise StopException.new
|
32
|
+
end
|
33
|
+
}
|
34
|
+
if stats.all?
|
35
|
+
exit(0)
|
36
|
+
else
|
37
|
+
exit(1)
|
38
|
+
end
|
39
|
+
rescue StopException
|
40
|
+
logger.info("stopped.")
|
30
41
|
exit(1)
|
31
42
|
end
|
32
43
|
end
|
44
|
+
|
45
|
+
class StopException < StandardError
|
46
|
+
end
|
33
47
|
end
|
34
48
|
end
|
35
49
|
end
|
@@ -196,8 +196,8 @@ module Hotdog
|
|
196
196
|
}
|
197
197
|
rule(:identifier_glob) {
|
198
198
|
( binary_op.absent? >> unary_op.absent? >> identifier.repeat(0) >> (glob >> identifier.maybe).repeat(1) \
|
199
|
-
| binary_op >>
|
200
|
-
| unary_op >>
|
199
|
+
| binary_op >> (glob >> identifier.maybe).repeat(1) \
|
200
|
+
| unary_op >> (glob >> identifier.maybe).repeat(1) \
|
201
201
|
)
|
202
202
|
}
|
203
203
|
rule(:identifier) {
|
@@ -217,8 +217,8 @@ module Hotdog
|
|
217
217
|
}
|
218
218
|
rule(:attribute_glob) {
|
219
219
|
( binary_op.absent? >> unary_op.absent? >> attribute.repeat(0) >> (glob >> attribute.maybe).repeat(1) \
|
220
|
-
| binary_op >>
|
221
|
-
| unary_op >>
|
220
|
+
| binary_op >> (glob >> attribute.maybe).repeat(1) \
|
221
|
+
| unary_op >> (glob >> attribute.maybe).repeat(1) \
|
222
222
|
)
|
223
223
|
}
|
224
224
|
rule(:attribute) {
|
data/lib/hotdog/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotdog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yamashita Yuu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|