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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5295f868cdb91eb708ae603119f352c45d3ef5fe
4
- data.tar.gz: fdfde295e6a4085a79052dd4546804263f29b23e
3
+ metadata.gz: 5b2a0b1eef15af3f384082c0f261aae828ea2153
4
+ data.tar.gz: a1a1f92a40f0dc38c82e809caf7c62daae466b00
5
5
  SHA512:
6
- metadata.gz: b866ac1631345db40f2a8847e7a642dd25e71f6812e5e03c69fa2c24a11ded94cd2252593a2132ab512ca1e0366716809b94d02a94a9e819d077aa518761ff66
7
- data.tar.gz: 5054683877ed189a7617d543e8aee69862ee19b8cb0fa7b3779da00a9281d3dfd92c31393f5d54a2d4ec066fe107b87bde48fdf303682179042d114cdeaf4365
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
- machine_spec.save(action_handler)
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(action_handler)
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(action_handler)
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(action_handler)
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
@@ -1,3 +1,3 @@
1
1
  module ChefMetal
2
- VERSION = '0.11.beta.7'
2
+ VERSION = '0.11.beta.8'
3
3
  end
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.7
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-05-31 00:00:00.000000000 Z
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.3
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.3
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