bunka 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/bunka +2 -1
- data/bunka.gemspec +1 -1
- data/lib/bunka.rb +5 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2f4ae862ed5def414a479c371c79c4da80695b5
|
4
|
+
data.tar.gz: 26ecab7c3a36d9422d0dfc42b0d53dbb7df4387e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a44cb8758b185129f890a7e91b67c12aae9ad9969d205e65050007b0a261c5f1aadbd3cf98f4273dcbce43fb1aa85dcd433a8409c491118252648e117ab84bda
|
7
|
+
data.tar.gz: c4ef94336c0838f4abd32ec522707efa7e4b43ba245e2cc03988d01aa5941313bc59bca2a30f38b264ce3be4ae0ba6e60276953f68d56146ceb1d1bb9468785f
|
data/bin/bunka
CHANGED
@@ -10,9 +10,10 @@ class BunkaCommand < Thor
|
|
10
10
|
option :sequential, type: :boolean, desc: 'run over nodes sequantially', default: false
|
11
11
|
option :invert, type: :boolean, desc: 'invert matched results', default: false
|
12
12
|
option :timeout, type: :numeric, desc: 'timeout interval per ssh connection (default: 15)', default: 15
|
13
|
+
option :threads, type: :numeric, desc: 'number of threads (default: 15)', default: 15
|
13
14
|
option :'print-success', type: :boolean, desc: 'prints output of successful commands', default: false
|
14
15
|
def test(command, query='name:*')
|
15
|
-
Bunka.test(command, query, options[:timeout], options[:'print-success'], options[:invert], options[:sequential])
|
16
|
+
Bunka.test(command, query, options[:timeout], options[:'print-success'], options[:invert], options[:sequential], options[:threads])
|
16
17
|
end
|
17
18
|
end
|
18
19
|
|
data/bunka.gemspec
CHANGED
data/lib/bunka.rb
CHANGED
@@ -8,20 +8,21 @@ require 'bunka/ssh'
|
|
8
8
|
|
9
9
|
class Bunka
|
10
10
|
class << self
|
11
|
-
def test command, query, timeout_interval, verbose_success, invert, sequential
|
11
|
+
def test command, query, timeout_interval, verbose_success, invert, sequential, threads
|
12
12
|
@command = command
|
13
|
+
@invert = invert
|
13
14
|
@query = query
|
15
|
+
@sequential = sequential
|
16
|
+
@threads = threads
|
14
17
|
@timeout_interval = timeout_interval
|
15
18
|
@verbose_success = verbose_success
|
16
|
-
@invert = invert
|
17
|
-
@sequential = sequential
|
18
19
|
|
19
20
|
if sequential
|
20
21
|
knife_search(@query).each do |fqdn|
|
21
22
|
execute_query fqdn
|
22
23
|
end
|
23
24
|
else
|
24
|
-
Parallel.map(knife_search(@query), in_threads:
|
25
|
+
Parallel.map(knife_search(@query), in_threads: @threads) do |fqdn|
|
25
26
|
execute_query fqdn
|
26
27
|
end
|
27
28
|
end
|