chef 11.12.0-x86-mingw32 → 11.12.2-x86-mingw32

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1715fff9e95389b926a226b9c8f26b908f0fafb
4
- data.tar.gz: 2e579c47c42d4c7bfe53ef675823038383f4d349
3
+ metadata.gz: e8569627190d2efc4f966d9a016c1816bc865826
4
+ data.tar.gz: 158cc0a37657509979c45c548fc62554a9819444
5
5
  SHA512:
6
- metadata.gz: 928b5de97c2254799f0abf4ac170f4ebe233b36d756d7ad8c7f5281e9911524113aa0329810e3373cc887ba64310d548e7c488f027692c7b00e789fd0c94db43
7
- data.tar.gz: 6fe410164d43b2acaa99e0079286a89609768bdcd9433f6ddc8b8b00ca323c534f24b8d607f51643a7300a360ee0406df1950a461765f025a11383207e80e762
6
+ metadata.gz: ca943559b89c38f60aec250a527ce38f7d2aac0f76e4c1dab2de78986b7612660aa614d7f3cc4f09803446520d7f2698cd4aa7a705708e7585c8f2c77c71b13c
7
+ data.tar.gz: 00b109ada95a45d2782b105fd6c596aab4597638e8ae04c556c34b22a12c63630377ee80389841581b3aa8f90defff897f0e6d97c8166058d552af4cecb54c0f
@@ -247,7 +247,12 @@ class Chef
247
247
  tmp_stderr = $stderr = StringIO.new
248
248
  abs_path = File.expand_path(ruby_file)
249
249
  file_content = IO.read(abs_path)
250
- RubyVM::InstructionSequence.new(file_content, ruby_file, abs_path, 0)
250
+ # We have to wrap this in a block so the user code evaluates in a
251
+ # similar context as what Chef does normally. Otherwise RubyVM
252
+ # will reject some common idioms, like using `return` to end evaluation
253
+ # of a recipe. See also CHEF-5199
254
+ wrapped_content = "Object.new.instance_eval do\n#{file_content}\nend\n"
255
+ RubyVM::InstructionSequence.new(wrapped_content, ruby_file, abs_path, 0)
251
256
  true
252
257
  rescue SyntaxError
253
258
  $stderr = old_stderr
@@ -50,7 +50,10 @@ class Chef
50
50
  end
51
51
 
52
52
  def handle_chunk(next_chunk)
53
- @stream_handlers.inject(next_chunk) do |chunk, handler|
53
+ # stream handlers handle responses so must be applied in reverse order
54
+ # (same as #apply_stream_complete_middleware or #apply_response_midddleware)
55
+ @stream_handlers.reverse.inject(next_chunk) do |chunk, handler|
56
+ Chef::Log.debug("Chef::HTTP::StreamHandler calling #{handler.class}#handle_chunk")
54
57
  handler.handle_chunk(chunk)
55
58
  end
56
59
  end
@@ -210,18 +213,21 @@ class Chef
210
213
 
211
214
  def apply_request_middleware(method, url, headers, data)
212
215
  middlewares.inject([method, url, headers, data]) do |req_data, middleware|
216
+ Chef::Log.debug("Chef::HTTP calling #{middleware.class}#handle_request")
213
217
  middleware.handle_request(*req_data)
214
218
  end
215
219
  end
216
220
 
217
221
  def apply_response_middleware(response, rest_request, return_value)
218
222
  middlewares.reverse.inject([response, rest_request, return_value]) do |res_data, middleware|
223
+ Chef::Log.debug("Chef::HTTP calling #{middleware.class}#handle_response")
219
224
  middleware.handle_response(*res_data)
220
225
  end
221
226
  end
222
227
 
223
228
  def apply_stream_complete_middleware(response, rest_request, return_value)
224
229
  middlewares.reverse.inject([response, rest_request, return_value]) do |res_data, middleware|
230
+ Chef::Log.debug("Chef::HTTP calling #{middleware.class}#handle_stream_complete")
225
231
  middleware.handle_stream_complete(*res_data)
226
232
  end
227
233
  end
@@ -253,14 +259,6 @@ class Chef
253
259
  end
254
260
  @last_response = response
255
261
 
256
- Chef::Log.debug("---- HTTP Status and Header Data: ----")
257
- Chef::Log.debug("HTTP #{response.http_version} #{response.code} #{response.msg}")
258
-
259
- response.each do |header, value|
260
- Chef::Log.debug("#{header}: #{value}")
261
- end
262
- Chef::Log.debug("---- End HTTP Status/Header Data ----")
263
-
264
262
  if response.kind_of?(Net::HTTPSuccess)
265
263
  [response, request, return_value]
266
264
  elsif response.kind_of?(Net::HTTPNotModified) # Must be tested before Net::HTTPRedirection because it's subclass.
@@ -61,7 +61,16 @@ class Chef
61
61
  base_headers.each do |name, value|
62
62
  Chef::Log.debug("#{name}: #{value}")
63
63
  end
64
+ Chef::Log.debug("---- End HTTP Request Header Data ----")
64
65
  http_client.request(http_request) do |response|
66
+ Chef::Log.debug("---- HTTP Status and Header Data: ----")
67
+ Chef::Log.debug("HTTP #{response.http_version} #{response.code} #{response.msg}")
68
+
69
+ response.each do |header, value|
70
+ Chef::Log.debug("#{header}: #{value}")
71
+ end
72
+ Chef::Log.debug("---- End HTTP Status/Header Data ----")
73
+
65
74
  yield response if block_given?
66
75
  # http_client.request may not have the return signature we want, so
67
76
  # force the issue:
@@ -17,7 +17,7 @@
17
17
 
18
18
  class Chef
19
19
  CHEF_ROOT = File.dirname(File.expand_path(File.dirname(__FILE__)))
20
- VERSION = '11.12.0'
20
+ VERSION = '11.12.2'
21
21
  end
22
22
 
23
23
  # NOTE: the Chef::Version class is defined in version_class.rb
@@ -1,3 +1,4 @@
1
+
1
2
  cat "blanket" do
2
3
  pretty_kitty true
3
4
  end
@@ -0,0 +1,2 @@
1
+ # CHEF-5199 regression test.
2
+ return nil
@@ -24,7 +24,7 @@ describe Chef::Cookbook::SyntaxCheck do
24
24
  let(:cookbook_path) { File.join(CHEF_SPEC_DATA, 'cookbooks', 'openldap') }
25
25
  let(:syntax_check) { Chef::Cookbook::SyntaxCheck.new(cookbook_path) }
26
26
 
27
- let(:open_ldap_cookbook_files) {
27
+ let(:open_ldap_cookbook_files) do
28
28
  %w{ attributes/default.rb
29
29
  attributes/smokey.rb
30
30
  definitions/client.rb
@@ -32,8 +32,9 @@ describe Chef::Cookbook::SyntaxCheck do
32
32
  metadata.rb
33
33
  recipes/default.rb
34
34
  recipes/gigantor.rb
35
- recipes/one.rb }.map{ |f| File.join(cookbook_path, f) }
36
- }
35
+ recipes/one.rb
36
+ recipes/return.rb }.map{ |f| File.join(cookbook_path, f) }
37
+ end
37
38
 
38
39
  before do
39
40
  Chef::Log.logger = Logger.new(StringIO.new)
@@ -41,7 +42,7 @@ describe Chef::Cookbook::SyntaxCheck do
41
42
 
42
43
  @attr_files = %w{default.rb smokey.rb}.map { |f| File.join(cookbook_path, 'attributes', f) }
43
44
  @defn_files = %w{client.rb server.rb}.map { |f| File.join(cookbook_path, 'definitions', f)}
44
- @recipes = %w{default.rb gigantor.rb one.rb}.map { |f| File.join(cookbook_path, 'recipes', f) }
45
+ @recipes = %w{default.rb gigantor.rb one.rb return.rb}.map { |f| File.join(cookbook_path, 'recipes', f) }
45
46
  @ruby_files = @attr_files + @defn_files + @recipes + [File.join(cookbook_path, "metadata.rb")]
46
47
  basenames = %w{ helpers_via_partial_test.erb
47
48
  helper_test.erb
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.12.0
4
+ version: 11.12.2
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-08 00:00:00.000000000 Z
11
+ date: 2014-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-config
@@ -1401,6 +1401,7 @@ files:
1401
1401
  - spec/data/cookbooks/openldap/recipes/default.rb
1402
1402
  - spec/data/cookbooks/openldap/recipes/gigantor.rb
1403
1403
  - spec/data/cookbooks/openldap/recipes/one.rb
1404
+ - spec/data/cookbooks/openldap/recipes/return.rb
1404
1405
  - spec/data/cookbooks/openldap/templates/default/all_windows_line_endings.erb
1405
1406
  - spec/data/cookbooks/openldap/templates/default/helper_test.erb
1406
1407
  - spec/data/cookbooks/openldap/templates/default/helpers_via_partial_test.erb