chef-metal 0.11.beta.7 → 0.11.beta.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -1
- data/lib/chef/provider/machine_batch.rb +6 -31
- data/lib/chef/resource/machine_batch.rb +28 -0
- data/lib/chef_metal/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b2a0b1eef15af3f384082c0f261aae828ea2153
|
4
|
+
data.tar.gz: a1a1f92a40f0dc38c82e809caf7c62daae466b00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0abf3f71bee93b7145efd6c0a0243b0d2a21f8dee731ef0f704426f3314456e7adb506d3be3028b6de8ba83e80da25fe5c26da756fd586c0fa17e16970bd74da
|
7
|
+
data.tar.gz: 05118c1aa639c6b89b10a3b5a43a53a1ce5ca78120f8f69ad5384c5a3847443798b4e5e1a4884a6db0e94b22e9d9ba4acdbb79802bcfcaedea8bd68562b696cc
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# Chef Metal Changelog
|
2
|
+
## 0.11.beta.9 (6/3/2014)
|
3
|
+
|
4
|
+
- fix machine_batch error report to be less verbose
|
2
5
|
|
3
6
|
## 0.11.beta.7 (5/30/2014)
|
4
7
|
|
5
|
-
- fix machine_batch error report to be less verbose
|
6
8
|
- allow options to be set from with_driver
|
7
9
|
- fail when machine is being moved from driver to driver
|
8
10
|
- support knife.rb config for non-canonical URLs
|
@@ -12,33 +12,6 @@ class Chef::Provider::MachineBatch < Chef::Provider::LWRPBase
|
|
12
12
|
@action_handler ||= ChefMetal::ChefProviderActionHandler.new(self)
|
13
13
|
end
|
14
14
|
|
15
|
-
# We override this because we want to hide @from_recipe
|
16
|
-
def to_text
|
17
|
-
ivars = instance_variables.map { |ivar| ivar.to_sym } - HIDDEN_IVARS - [ :@from_recipe, :@machines ]
|
18
|
-
text = "# Declared in #{@source_line}\n\n"
|
19
|
-
text << self.class.dsl_name + "(\"#{name}\") do\n"
|
20
|
-
ivars.each do |ivar|
|
21
|
-
if (value = instance_variable_get(ivar)) && !(value.respond_to?(:empty?) && value.empty?)
|
22
|
-
value_string = value.respond_to?(:to_text) ? value.to_text : value.inspect
|
23
|
-
text << " #{ivar.to_s.sub(/^@/,'')} #{value_string}\n"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
machine_names = @machines.map do |m|
|
27
|
-
if m.is_a?(ChefMetal::MachineSpec)
|
28
|
-
m.name
|
29
|
-
elsif m.is_a?(Chef::Resource::Machine)
|
30
|
-
m.name
|
31
|
-
else
|
32
|
-
m
|
33
|
-
end
|
34
|
-
end
|
35
|
-
text << " machines #{machine_names.inspect}"
|
36
|
-
[@not_if, @only_if].flatten.each do |conditional|
|
37
|
-
text << " #{conditional.to_text}\n"
|
38
|
-
end
|
39
|
-
text << "end\n"
|
40
|
-
end
|
41
|
-
|
42
15
|
use_inline_resources
|
43
16
|
|
44
17
|
def whyrun_supported?
|
@@ -52,7 +25,8 @@ class Chef::Provider::MachineBatch < Chef::Provider::LWRPBase
|
|
52
25
|
action :allocate do
|
53
26
|
by_new_driver.each do |driver, specs_and_options|
|
54
27
|
driver.allocate_machines(action_handler, specs_and_options, parallelizer) do |machine_spec|
|
55
|
-
|
28
|
+
prefixed_handler = ChefMetal::AddPrefixActionHandler.new(action_handler, "[#{machine_spec.name}] ")
|
29
|
+
machine_spec.save(prefixed_handler)
|
56
30
|
end
|
57
31
|
end
|
58
32
|
end
|
@@ -65,7 +39,7 @@ class Chef::Provider::MachineBatch < Chef::Provider::LWRPBase
|
|
65
39
|
with_ready_machines do |m|
|
66
40
|
prefixed_handler = ChefMetal::AddPrefixActionHandler.new(action_handler, "[#{m[:spec].name}] ")
|
67
41
|
machine[:machine].setup_convergence(prefixed_handler)
|
68
|
-
m[:spec].save(
|
42
|
+
m[:spec].save(prefixed_handler)
|
69
43
|
Chef::Provider::Machine.upload_files(prefixed_handler, m[:machine], m[:files])
|
70
44
|
end
|
71
45
|
end
|
@@ -77,14 +51,15 @@ class Chef::Provider::MachineBatch < Chef::Provider::LWRPBase
|
|
77
51
|
m[:spec].save(action_handler)
|
78
52
|
Chef::Provider::Machine.upload_files(prefixed_handler, m[:machine], m[:files])
|
79
53
|
m[:machine].converge(prefixed_handler)
|
80
|
-
m[:spec].save(
|
54
|
+
m[:spec].save(prefixed_handler)
|
81
55
|
end
|
82
56
|
end
|
83
57
|
|
84
58
|
action :converge_only do
|
85
59
|
parallel_do(@machines) do |m|
|
60
|
+
prefixed_handler = ChefMetal::AddPrefixActionHandler.new(action_handler, "[#{m[:spec].name}] ")
|
86
61
|
machine = run_context.chef_metal.connect_to_machine(m[:spec])
|
87
|
-
machine.converge(
|
62
|
+
machine.converge(prefixed_handler)
|
88
63
|
end
|
89
64
|
end
|
90
65
|
|
@@ -41,4 +41,32 @@ class Chef::Resource::MachineBatch < Chef::Resource::LWRPBase
|
|
41
41
|
def add_machine_options(options)
|
42
42
|
@machine_options = Chef::Mixin::DeepMerge.hash_only_merge(@machine_options, options)
|
43
43
|
end
|
44
|
+
|
45
|
+
# We override this because we want to hide @from_recipe and shorten @machines
|
46
|
+
# in error output.
|
47
|
+
def to_text
|
48
|
+
ivars = instance_variables.map { |ivar| ivar.to_sym } - HIDDEN_IVARS - [ :@from_recipe, :@machines ]
|
49
|
+
text = "# Declared in #{@source_line}\n\n"
|
50
|
+
text << self.class.dsl_name + "(\"#{name}\") do\n"
|
51
|
+
ivars.each do |ivar|
|
52
|
+
if (value = instance_variable_get(ivar)) && !(value.respond_to?(:empty?) && value.empty?)
|
53
|
+
value_string = value.respond_to?(:to_text) ? value.to_text : value.inspect
|
54
|
+
text << " #{ivar.to_s.sub(/^@/,'')} #{value_string}\n"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
machine_names = @machines.map do |m|
|
58
|
+
if m.is_a?(ChefMetal::MachineSpec)
|
59
|
+
m.name
|
60
|
+
elsif m.is_a?(Chef::Resource::Machine)
|
61
|
+
m.name
|
62
|
+
else
|
63
|
+
m
|
64
|
+
end
|
65
|
+
end
|
66
|
+
text << " machines #{machine_names.inspect}\n"
|
67
|
+
[@not_if, @only_if].flatten.each do |conditional|
|
68
|
+
text << " #{conditional.to_text}\n"
|
69
|
+
end
|
70
|
+
text << "end\n"
|
71
|
+
end
|
44
72
|
end
|
data/lib/chef_metal/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-metal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.beta.
|
4
|
+
version: 0.11.beta.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Keiser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - '='
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.5.beta.
|
103
|
+
version: 0.5.beta.4
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.5.beta.
|
110
|
+
version: 0.5.beta.4
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: chef-metal-vagrant
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|