knife-batch 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/knife-batch.gemspec +1 -1
- data/lib/chef/knife/batch.rb +16 -6
- data/lib/knife-batch/version.rb +1 -1
- metadata +41 -40
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d11fff75e65a52ac35c44563d6311fc4a31fe186
|
4
|
+
data.tar.gz: 6b6e4d515f0f7018ccb68d43b44c3d4b98a2aa5c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 470181bedfee95c3bfcc2470e641093ade78270bb271824c9da9c170d85a8793670eefa1c0240dfce5a9782f5e780a6705952b3f2e689161e0c53d497daf9792
|
7
|
+
data.tar.gz: c1e56cacc43eab0ea0b3ded163910299fd87afcf033343f678110855729917044230fcc5936d2269f555632ff3c27222121c31dc9d4616a0c975038e75683ab4
|
data/knife-batch.gemspec
CHANGED
data/lib/chef/knife/batch.rb
CHANGED
@@ -112,8 +112,16 @@ class Batch < Chef::Knife
|
|
112
112
|
q = Chef::Search::Query.new
|
113
113
|
@action_nodes = q.search(:node, @name_args[0])[0]
|
114
114
|
@action_nodes.each do |item|
|
115
|
-
|
116
|
-
|
115
|
+
next if item.nil?
|
116
|
+
if !config[:override_attribute] && item[:cloud] and item[:cloud][:public_hostname]
|
117
|
+
i = format_for_display(item)[config[:attribute]]
|
118
|
+
elsif config[:override_attribute]
|
119
|
+
i = extract_nested_value(item, config[:override_attribute])
|
120
|
+
else
|
121
|
+
i = extract_nested_value(item, config[:attribute])
|
122
|
+
end
|
123
|
+
next if i.nil?
|
124
|
+
r.push(i)
|
117
125
|
end
|
118
126
|
r
|
119
127
|
end
|
@@ -182,18 +190,20 @@ class Batch < Chef::Knife
|
|
182
190
|
@ssh_session = nil
|
183
191
|
end
|
184
192
|
|
193
|
+
def extract_nested_value(data_structure, path_spec)
|
194
|
+
ui.presenter.extract_nested_value(data_structure, path_spec)
|
195
|
+
end
|
196
|
+
|
185
197
|
def run
|
186
198
|
extend Chef::Mixin::Command
|
187
|
-
|
199
|
+
|
188
200
|
@longest = 0
|
189
201
|
all_nodes = get_nodes
|
190
202
|
all_nodes.each do |nodes|
|
191
203
|
session_from_list(nodes)
|
192
204
|
|
193
205
|
ssh_command(@name_args[1..-1].join(" "), nodes)
|
194
|
-
|
195
|
-
puts "Taking a nap for #{config[:wait]} seconds..."
|
196
|
-
puts "*" * 80
|
206
|
+
Chef::Log.info"Taking a nap for #{config[:wait]} seconds..."
|
197
207
|
sleep config[:wait].to_f
|
198
208
|
end
|
199
209
|
end
|
data/lib/knife-batch/version.rb
CHANGED
metadata
CHANGED
@@ -1,39 +1,44 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-batch
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 1.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
6
5
|
platform: ruby
|
7
|
-
authors:
|
6
|
+
authors:
|
8
7
|
- Ian Meyer
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2015-03-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
16
14
|
name: chef
|
17
|
-
|
18
|
-
|
19
|
-
none: false
|
20
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
21
17
|
- - ">="
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version:
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '11'
|
20
|
+
- - "~>"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '12'
|
24
23
|
type: :runtime
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '11'
|
30
|
+
- - "~>"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '12'
|
33
|
+
description: "`knife batch` is a wonderful little plugin for executing commands a
|
34
|
+
la `knife ssh`, but doing it in groups of `n` with a sleep between execution iterations."
|
35
|
+
email:
|
28
36
|
- ianmmeyer@gmail.com
|
29
37
|
executables: []
|
30
|
-
|
31
38
|
extensions: []
|
32
|
-
|
33
39
|
extra_rdoc_files: []
|
34
|
-
|
35
|
-
|
36
|
-
- .gitignore
|
40
|
+
files:
|
41
|
+
- ".gitignore"
|
37
42
|
- Gemfile
|
38
43
|
- README.markdown
|
39
44
|
- Rakefile
|
@@ -42,30 +47,26 @@ files:
|
|
42
47
|
- lib/knife-batch/version.rb
|
43
48
|
homepage: http://github.com/imeyer/knife-batch
|
44
49
|
licenses: []
|
45
|
-
|
50
|
+
metadata: {}
|
46
51
|
post_install_message:
|
47
52
|
rdoc_options: []
|
48
|
-
|
49
|
-
require_paths:
|
53
|
+
require_paths:
|
50
54
|
- lib
|
51
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
-
|
53
|
-
requirements:
|
55
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
54
57
|
- - ">="
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version:
|
57
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
-
|
59
|
-
requirements:
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
60
62
|
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version:
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
63
65
|
requirements: []
|
64
|
-
|
65
66
|
rubyforge_project: knife-batch
|
66
|
-
rubygems_version:
|
67
|
+
rubygems_version: 2.4.4
|
67
68
|
signing_key:
|
68
|
-
specification_version:
|
69
|
+
specification_version: 4
|
69
70
|
summary: Knife plugin to run ssh commands against batches of servers
|
70
71
|
test_files: []
|
71
|
-
|
72
|
+
has_rdoc:
|