bunka 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/bunka +2 -1
- data/bunka.gemspec +1 -1
- data/lib/bunka.rb +6 -11
- data/lib/bunka/bunka.rb +8 -0
- 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: 7ea509355512cd6fe9f244e9412e4090f2845a32
|
4
|
+
data.tar.gz: d73ab4d22d8018311246d6bba7cd146e699337c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a346a2846218bf64a1b24ada95601e2955d076b7c60e037d767e7e098366545e46256a8dffae97fe7aedcddaa0d44d869ad517f60f2932e9e110dbd22733cab
|
7
|
+
data.tar.gz: d1109c881b61c9d7e9a8bbfa0d8bb00cfdb6bf12d9d1a4dc36d0d612a160ff54397033be8aa209e228179154aff1f83193aed8704a0465b0e90cc274494331f0
|
data/bin/bunka
CHANGED
@@ -12,8 +12,9 @@ class BunkaCommand < Thor
|
|
12
12
|
option :timeout, type: :numeric, desc: 'timeout interval per ssh connection (default: 15)', default: 15
|
13
13
|
option :threads, type: :numeric, desc: 'number of threads (default: 15)', default: 15
|
14
14
|
option :'print-success', type: :boolean, desc: 'prints output of successful commands', default: false
|
15
|
+
option :'from-file', type: :string, desc: 'path to file with list of servers', default: nil
|
15
16
|
def test(command, query='name:*')
|
16
|
-
Bunka.test(command, query, options[:timeout], options[:'print-success'], options[:invert], options[:sequential], options[:threads])
|
17
|
+
Bunka.test(command, query, options[:timeout], options[:'print-success'], options[:invert], options[:sequential], options[:threads], options[:'from-file'])
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
data/bunka.gemspec
CHANGED
data/lib/bunka.rb
CHANGED
@@ -1,30 +1,25 @@
|
|
1
1
|
require 'parallel'
|
2
2
|
|
3
|
+
require 'bunka/bunka'
|
3
4
|
require 'bunka/chef'
|
4
5
|
require 'bunka/helpers'
|
5
6
|
require 'bunka/printers'
|
6
|
-
require 'bunka/bunka'
|
7
7
|
require 'bunka/ssh'
|
8
8
|
|
9
9
|
class Bunka
|
10
10
|
class << self
|
11
|
-
def test command, query, timeout_interval, verbose_success, invert, sequential, threads
|
11
|
+
def test command, query, timeout_interval, verbose_success, invert, sequential, threads, file=nil
|
12
12
|
@command = command
|
13
13
|
@invert = invert
|
14
14
|
@query = query
|
15
15
|
@sequential = sequential
|
16
|
-
@threads = threads
|
16
|
+
@threads = sequential ? 1 : threads
|
17
17
|
@timeout_interval = timeout_interval
|
18
18
|
@verbose_success = verbose_success
|
19
|
+
@file = file
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
execute_query fqdn
|
23
|
-
end
|
24
|
-
else
|
25
|
-
Parallel.map(knife_search(@query), in_threads: @threads) do |fqdn|
|
26
|
-
execute_query fqdn
|
27
|
-
end
|
21
|
+
Parallel.map(nodes, in_threads: @threads) do |fqdn|
|
22
|
+
execute_query fqdn
|
28
23
|
end
|
29
24
|
|
30
25
|
print_summary
|
data/lib/bunka/bunka.rb
CHANGED