chef 12.0.0 → 12.0.1

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: 1bef47bedec10e78a63b563578b47919c68066b9
4
- data.tar.gz: 2073eef92ea6cc252afa09d2c047de4798d6c997
3
+ metadata.gz: e11671748225ec17a9c6a23041fa3cff028f640c
4
+ data.tar.gz: 54f0f6d8d85c7cebadf90892e102bc36caa6a420
5
5
  SHA512:
6
- metadata.gz: efd4822d4ef0e0b4c01666d8093faf3a238cab14b3e421d802be7e19b666d51b2ba39e1c710cbd1e0dee6e8210ba4539a77e9a71aa2a889d317eb191f3f15897
7
- data.tar.gz: 4a7d25fc7c1592c5484e7c47b8bfa38c5db25fed17c6d08c76a8e2d226ab173db93d3f7063c74462e148e8f865c29b5b59fc9bfb4179a1fbe73e019e0e3ab957
6
+ metadata.gz: 23faed269443bad8321dd3214a33f610c41a5853d541a2d93fa5cbdda8d51ff6d79f6fa6d6e934a881bf50d8c7303915b7f53a8757a2b3f4f43b933a7b0001a8
7
+ data.tar.gz: 15c8402828acf3b4080226341fabaa90d2dcc10dd44c4a47939e8a8e36b9e8eb257276caa7eabf29f9df7d1acfa2ab9f2338ad028d494f944958f31beb69f85c
@@ -272,7 +272,9 @@ class Chef::Application::Client < Chef::Application
272
272
  Chef::Config[:splay] = nil
273
273
  end
274
274
 
275
- Chef::Application.fatal!(unforked_interval_error_message) if !Chef::Config[:client_fork] && Chef::Config[:interval]
275
+ if !Chef::Config[:client_fork] && Chef::Config[:interval] && !Chef::Platform.windows?
276
+ Chef::Application.fatal!(unforked_interval_error_message)
277
+ end
276
278
 
277
279
  if Chef::Config[:json_attribs]
278
280
  config_fetcher = Chef::ConfigFetcher.new(Chef::Config[:json_attribs])
@@ -20,9 +20,11 @@ require 'chef/event_loggers/base'
20
20
  require 'chef/platform/query_helpers'
21
21
 
22
22
  if Chef::Platform::windows? and not Chef::Platform::windows_server_2003?
23
- [:INFINITE, :WAIT_FAILED, :FORMAT_MESSAGE_IGNORE_INSERTS, :ERROR_INSUFFICIENT_BUFFER].each do |c|
24
- # These are redefined in 'win32/eventlog'
25
- Windows::Constants.send(:remove_const, c)
23
+ if defined? Windows::Constants
24
+ [:INFINITE, :WAIT_FAILED, :FORMAT_MESSAGE_IGNORE_INSERTS, :ERROR_INSUFFICIENT_BUFFER].each do |c|
25
+ # These are redefined in 'win32/eventlog'
26
+ Windows::Constants.send(:remove_const, c) if Windows::Constants.const_defined? c
27
+ end
26
28
  end
27
29
 
28
30
  require 'win32/eventlog'
@@ -30,7 +30,7 @@ class Chef
30
30
  #
31
31
  class BootstrapContext
32
32
 
33
- def initialize(config, run_list, chef_config, secret)
33
+ def initialize(config, run_list, chef_config, secret = nil)
34
34
  @config = config
35
35
  @run_list = run_list
36
36
  @chef_config = chef_config
@@ -92,10 +92,8 @@ class Chef
92
92
  provider_class = Chef::Provider.const_get(class_name)
93
93
  else
94
94
  provider_class = Class.new(self)
95
- provider_class.class_from_file(filename)
96
-
97
- class_name = convert_to_class_name(provider_name)
98
95
  Chef::Provider.const_set(class_name, provider_class)
96
+ provider_class.class_from_file(filename)
99
97
  Chef::Log.debug("Loaded contents of #{filename} into a provider named #{provider_name} defined in Chef::Provider::#{class_name}")
100
98
  end
101
99
 
@@ -36,6 +36,7 @@ class Chef
36
36
  @cwd = nil
37
37
  @environment = nil
38
38
  @group = nil
39
+ @path = nil
39
40
  @returns = 0
40
41
  @timeout = nil
41
42
  @user = nil
@@ -94,6 +95,16 @@ class Chef
94
95
  )
95
96
  end
96
97
 
98
+ def path(arg=nil)
99
+ Chef::Log.warn "'path' attribute of 'execute' is not used by any provider in Chef 11 and Chef 12. Use 'environment' attribute to configure 'PATH'. This attribute will be removed in Chef 13."
100
+
101
+ set_or_return(
102
+ :path,
103
+ arg,
104
+ :kind_of => [ Array ]
105
+ )
106
+ end
107
+
97
108
  def returns(arg=nil)
98
109
  set_or_return(
99
110
  :returns,
@@ -46,11 +46,11 @@ class Chef
46
46
  else
47
47
  resource_class = Class.new(self)
48
48
 
49
+ Chef::Resource.const_set(class_name, resource_class)
49
50
  resource_class.resource_name = rname
50
51
  resource_class.run_context = run_context
51
52
  resource_class.class_from_file(filename)
52
53
 
53
- Chef::Resource.const_set(class_name, resource_class)
54
54
  Chef::Log.debug("Loaded contents of #{filename} into a resource named #{rname} defined in Chef::Resource::#{class_name}")
55
55
  end
56
56
 
@@ -17,7 +17,7 @@
17
17
 
18
18
  class Chef
19
19
  CHEF_ROOT = File.dirname(File.expand_path(File.dirname(__FILE__)))
20
- VERSION = '12.0.0'
20
+ VERSION = '12.0.1'
21
21
  end
22
22
 
23
23
  #
@@ -1,3 +1,4 @@
1
+ provides 'buck_passer'
1
2
  action :pass_buck do
2
3
  lwrp_foo :prepared_thumbs do
3
4
  action :prepare_thumbs
@@ -1 +1,2 @@
1
+ provides "lwrp_bar" # This makes sure that we cover the case of lwrps using provides
1
2
  actions :pass_buck, :prepare_eyes, :watch_paint_dry
@@ -76,6 +76,12 @@ shared_examples_for "an execute resource" do
76
76
  @resource.group.should eql(1)
77
77
  end
78
78
 
79
+ it "should accept an array for the execution path in Chef-12 and log deprecation message" do
80
+ expect(Chef::Log).to receive(:warn).at_least(:once)
81
+ @resource.path ["woot"]
82
+ expect(@resource.path).to eql(["woot"])
83
+ end
84
+
79
85
  it "should accept an integer for the return code" do
80
86
  @resource.returns 1
81
87
  @resource.returns.should eql(1)
@@ -63,6 +63,18 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config
63
63
  end
64
64
  end
65
65
 
66
+ context "when interval is given on windows" do
67
+ before do
68
+ Chef::Config[:interval] = 600
69
+ allow(Chef::Platform).to receive(:windows?).and_return(true)
70
+ end
71
+
72
+ it "should not terminate" do
73
+ expect(Chef::Application).not_to receive(:fatal!)
74
+ @app.reconfigure
75
+ end
76
+ end
77
+
66
78
  context "when configured to run once" do
67
79
  before do
68
80
  Chef::Config[:once] = true
@@ -34,6 +34,10 @@ describe Chef::Knife::Core::BootstrapContext do
34
34
 
35
35
  subject(:bootstrap_context) { described_class.new(config, run_list, chef_config, secret) }
36
36
 
37
+ it "initializes with Chef 11 parameters" do
38
+ expect{described_class.new(config, run_list, chef_config)}.not_to raise_error
39
+ end
40
+
37
41
  it "runs chef with the first-boot.json in the _default environment" do
38
42
  bootstrap_context.start_chef.should eq "chef-client -j /etc/chef/first-boot.json -E _default"
39
43
  end
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: 12.0.0
4
+ version: 12.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-05 00:00:00.000000000 Z
11
+ date: 2014-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-config