knife-update 0.0.7 → 0.1.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 +8 -8
- data/lib/chef/knife/update.rb +3 -2
- data/lib/chef/knife/update_recipes.rb +5 -4
- data/lib/chef/knife/update_run.rb +2 -2
- data/lib/knife-update/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjdlY2Q1MDg5MmFiYWExMmIyMTI0YjBjN2ZlYWVjYjJlNjI3MmRmNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTU4ZGVlMzc0MWM5ZDM1NDcxYjAzZDFhZjNhMWE0YWQ5ODZhOTY2Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2E1OGFjMmU4ZmI4NmI2NGEyNTc2MGM5ZGIwMTNlMjk0ZjA3NDgyYzJjMzNl
|
10
|
+
NGEzMmVkNTI4ZDJhZDE5ZTkzZDI4MGU1ZWQyYmYzZTM1M2UyMzVhZGQzNzZj
|
11
|
+
N2YwZWFiN2Y5YThhNzY0YWE0NjAwMjZiNTM3NjgzMDAxZmEzMmI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGZiNzdlYTkyYTk3ZmNiODliMWQ3MmUxODM3YTMyYjlkMjZiM2NjNzNiMGQy
|
14
|
+
MWJiZjE1MmJiZmQyN2I1Njk4NDAyMGJiNzRmYTMyNGFmZTg0ZWUwZWZiZDY2
|
15
|
+
Y2Y4ZTEzMTFhYjZiZDc1OWQxZjMxNWQzNmRiYTViOTIxMWU5NDQ=
|
data/lib/chef/knife/update.rb
CHANGED
@@ -69,9 +69,10 @@ class Chef
|
|
69
69
|
|
70
70
|
# List of all compatible recipes
|
71
71
|
def recipes(nodes)
|
72
|
-
nodes.inject(
|
72
|
+
nodes.inject({}) do |memo, node|
|
73
73
|
node.recipes.each do |recipe|
|
74
|
-
memo
|
74
|
+
memo[recipe.to_s] ||= 0
|
75
|
+
memo[recipe.to_s] += 1
|
75
76
|
end
|
76
77
|
|
77
78
|
memo
|
@@ -28,11 +28,12 @@ class Chef
|
|
28
28
|
def run
|
29
29
|
list = node_list
|
30
30
|
compatible = recipes(only(list, target_version))
|
31
|
-
|
31
|
+
old = recipes(except(list, target_version))
|
32
|
+
unknown = compatible.each { |recipe, _| old.delete(recipe) }
|
32
33
|
|
33
34
|
if compatible.any?
|
34
35
|
ui.msg "recipes already used on Chef #{target_version}:"
|
35
|
-
compatible.
|
36
|
+
compatible.sort_by { |k, _| k }.each do |item, _|
|
36
37
|
ui.msg " #{item}"
|
37
38
|
end
|
38
39
|
ui.msg ''
|
@@ -40,8 +41,8 @@ class Chef
|
|
40
41
|
|
41
42
|
if unknown.any?
|
42
43
|
ui.msg "recipes not used on Chef #{target_version}:"
|
43
|
-
unknown.
|
44
|
-
ui.msg " #{item}"
|
44
|
+
unknown.sort_by { |k, _| k }.each do |item, nodes|
|
45
|
+
ui.msg " #{item} (used on #{nodes} nodes)"
|
45
46
|
end
|
46
47
|
ui.msg ''
|
47
48
|
end
|
@@ -86,7 +86,7 @@ class Chef
|
|
86
86
|
nodes = list.inject([]) do |memo, (version, nodes)|
|
87
87
|
if version != target_version
|
88
88
|
nodes.each do |node|
|
89
|
-
if config[:force] || node.recipes.all? { |recipe| compatible.include?(recipe) }
|
89
|
+
if config[:force] || node.recipes.all? { |recipe| compatible.keys.include?(recipe) }
|
90
90
|
memo << node
|
91
91
|
end
|
92
92
|
end
|
@@ -96,7 +96,7 @@ class Chef
|
|
96
96
|
end
|
97
97
|
|
98
98
|
if config[:force] && unknown.any?
|
99
|
-
ui.warn "It's unknown if the following recipes are Chef #{target_version} compatible: #{unknown.sort.join(', ')}"
|
99
|
+
ui.warn "It's unknown if the following recipes are Chef #{target_version} compatible: #{unknown.keys.sort.join(', ')}"
|
100
100
|
end
|
101
101
|
|
102
102
|
if nodes.size > 0
|
data/lib/knife-update/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-update
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Schmidt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|
@@ -83,4 +83,3 @@ signing_key:
|
|
83
83
|
specification_version: 4
|
84
84
|
summary: knife update plugin
|
85
85
|
test_files: []
|
86
|
-
has_rdoc:
|