chef 10.14.2 → 10.14.4.rc.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.
- data/distro/common/html/chef-client.8.html +3 -3
- data/distro/common/html/chef-expander.8.html +3 -3
- data/distro/common/html/chef-expanderctl.8.html +3 -3
- data/distro/common/html/chef-server-webui.8.html +3 -3
- data/distro/common/html/chef-server.8.html +3 -3
- data/distro/common/html/chef-solo.8.html +3 -3
- data/distro/common/html/chef-solr.8.html +3 -3
- data/distro/common/html/knife-bootstrap.1.html +3 -3
- data/distro/common/html/knife-client.1.html +4 -4
- data/distro/common/html/knife-configure.1.html +3 -3
- data/distro/common/html/knife-cookbook-site.1.html +3 -3
- data/distro/common/html/knife-cookbook.1.html +3 -3
- data/distro/common/html/knife-data-bag.1.html +3 -3
- data/distro/common/html/knife-environment.1.html +6 -6
- data/distro/common/html/knife-exec.1.html +4 -4
- data/distro/common/html/knife-index.1.html +4 -4
- data/distro/common/html/knife-node.1.html +4 -4
- data/distro/common/html/knife-role.1.html +6 -6
- data/distro/common/html/knife-search.1.html +3 -3
- data/distro/common/html/knife-ssh.1.html +3 -3
- data/distro/common/html/knife-status.1.html +3 -3
- data/distro/common/html/knife-tag.1.html +4 -4
- data/distro/common/html/knife.1.html +3 -3
- data/distro/common/html/shef.1.html +7 -7
- data/distro/common/man/man1/knife-bootstrap.1 +1 -1
- data/distro/common/man/man1/knife-client.1 +1 -1
- data/distro/common/man/man1/knife-configure.1 +1 -1
- data/distro/common/man/man1/knife-cookbook-site.1 +1 -1
- data/distro/common/man/man1/knife-cookbook.1 +1 -1
- data/distro/common/man/man1/knife-data-bag.1 +1 -1
- data/distro/common/man/man1/knife-environment.1 +1 -1
- data/distro/common/man/man1/knife-exec.1 +1 -1
- data/distro/common/man/man1/knife-index.1 +1 -1
- data/distro/common/man/man1/knife-node.1 +1 -1
- data/distro/common/man/man1/knife-role.1 +1 -1
- data/distro/common/man/man1/knife-search.1 +1 -1
- data/distro/common/man/man1/knife-ssh.1 +1 -1
- data/distro/common/man/man1/knife-status.1 +1 -1
- data/distro/common/man/man1/knife-tag.1 +1 -1
- data/distro/common/man/man1/knife.1 +1 -1
- data/distro/common/man/man1/shef.1 +1 -1
- data/distro/common/man/man8/chef-client.8 +1 -1
- data/distro/common/man/man8/chef-expander.8 +1 -1
- data/distro/common/man/man8/chef-expanderctl.8 +1 -1
- data/distro/common/man/man8/chef-server-webui.8 +1 -1
- data/distro/common/man/man8/chef-server.8 +1 -1
- data/distro/common/man/man8/chef-solo.8 +1 -1
- data/distro/common/man/man8/chef-solr.8 +1 -1
- data/lib/chef/config.rb +1 -0
- data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +12 -3
- data/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb +0 -1
- data/lib/chef/formatters/error_inspectors/registration_error_inspector.rb +1 -1
- data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +5 -5
- data/lib/chef/knife/data_bag_edit.rb +1 -1
- data/lib/chef/knife/ssh.rb +15 -4
- data/lib/chef/platform.rb +1 -1
- data/lib/chef/provider/deploy.rb +9 -5
- data/lib/chef/provider/http_request.rb +15 -12
- data/lib/chef/version.rb +1 -1
- data/spec/data/cookbooks/angrybash/recipes/default.rb +8 -0
- data/spec/support/shared/unit/api_error_inspector.rb +14 -2
- data/spec/unit/config_spec.rb +17 -5
- data/spec/unit/cookbook_loader_spec.rb +5 -4
- data/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +58 -0
- data/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb +18 -0
- data/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +30 -0
- data/spec/unit/knife/ssh_spec.rb +63 -24
- data/spec/unit/platform_spec.rb +15 -3
- data/spec/unit/provider/deploy_spec.rb +45 -10
- data/spec/unit/provider/http_request_spec.rb +6 -0
- metadata +14 -9
data/spec/unit/platform_spec.rb
CHANGED
@@ -154,19 +154,31 @@ describe Chef::Platform do
|
|
154
154
|
node.platform_version("8.5")
|
155
155
|
Chef::Platform.find_provider_for_node(node, kitty).should eql(Chef::Provider::Cat)
|
156
156
|
end
|
157
|
-
|
158
|
-
|
157
|
+
|
158
|
+
def setup_file_resource
|
159
159
|
node = Chef::Node.new
|
160
160
|
node.platform("mac_os_x")
|
161
161
|
node.platform_version("9.2.2")
|
162
162
|
run_context = Chef::RunContext.new(node, {}, @events)
|
163
|
-
|
163
|
+
[ Chef::Resource::File.new("whateva", run_context), run_context ]
|
164
|
+
end
|
165
|
+
|
166
|
+
it "returns a provider object given a Chef::Resource object which has a valid run context and an action" do
|
167
|
+
file, run_context = setup_file_resource
|
164
168
|
provider = Chef::Platform.provider_for_resource(file, :foo)
|
165
169
|
provider.should be_an_instance_of(Chef::Provider::File)
|
166
170
|
provider.new_resource.should equal(file)
|
167
171
|
provider.run_context.should equal(run_context)
|
168
172
|
end
|
169
173
|
|
174
|
+
it "returns a provider object given a Chef::Resource object which has a valid run context without an action" do
|
175
|
+
file, run_context = setup_file_resource
|
176
|
+
provider = Chef::Platform.provider_for_resource(file)
|
177
|
+
provider.should be_an_instance_of(Chef::Provider::File)
|
178
|
+
provider.new_resource.should equal(file)
|
179
|
+
provider.run_context.should equal(run_context)
|
180
|
+
end
|
181
|
+
|
170
182
|
it "raises an error when trying to find the provider for a resource with no run context" do
|
171
183
|
file = Chef::Resource::File.new("whateva")
|
172
184
|
lambda {Chef::Platform.provider_for_resource(file)}.should raise_error(ArgumentError)
|
@@ -43,20 +43,32 @@ describe Chef::Provider::Deploy do
|
|
43
43
|
@provider.should respond_to(:action_rollback)
|
44
44
|
end
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
46
|
+
context "when the deploy_to dir does not exist yet" do
|
47
|
+
before do
|
48
|
+
FileUtils.should_receive(:mkdir_p).with(@resource.deploy_to).ordered
|
49
|
+
FileUtils.should_receive(:mkdir_p).with(@resource.shared_path).ordered
|
50
|
+
::Dir.should_receive(:chdir).with(@expected_release_dir).exactly(4).times
|
51
|
+
::File.stub!(:directory?).and_return(false)
|
52
|
+
@provider.stub(:symlink)
|
53
|
+
@provider.stub(:migrate)
|
54
|
+
@provider.stub(:copy_cached_repo)
|
55
|
+
end
|
56
|
+
|
57
|
+
it "creates deploy_to dir" do
|
58
|
+
@provider.stub(:update_cached_repo)
|
59
|
+
@provider.deploy
|
60
|
+
end
|
61
|
+
|
62
|
+
it "creates deploy_to dir before calling update_cached_repo (CHEF-3435)" do
|
63
|
+
@provider.send(:converge_actions).should_receive(:empty?).and_return(false)
|
64
|
+
@provider.should_receive(:update_cached_repo).ordered
|
65
|
+
@provider.deploy
|
66
|
+
end
|
56
67
|
end
|
57
68
|
|
58
69
|
it "does not create deploy_to dir if it exists" do
|
59
70
|
::File.stub!(:directory?).and_return(true)
|
71
|
+
::Dir.should_receive(:chdir).with(@expected_release_dir).exactly(4).times
|
60
72
|
FileUtils.should_not_receive(:mkdir_p).with(@resource.deploy_to)
|
61
73
|
FileUtils.should_not_receive(:mkdir_p).with(@resource.shared_path)
|
62
74
|
@provider.stub(:copy_cached_repo)
|
@@ -68,6 +80,7 @@ describe Chef::Provider::Deploy do
|
|
68
80
|
end
|
69
81
|
|
70
82
|
it "ensures the deploy_to dir ownership after the verfication that it exists" do
|
83
|
+
::Dir.should_receive(:chdir).with(@expected_release_dir).exactly(4).times
|
71
84
|
@provider.should_receive(:verify_directories_exist).ordered
|
72
85
|
@provider.should_receive(:enforce_ownership).ordered
|
73
86
|
@provider.stub(:copy_cached_repo)
|
@@ -281,11 +294,33 @@ describe Chef::Provider::Deploy do
|
|
281
294
|
it "skips an eval callback if the file doesn't exist" do
|
282
295
|
barbaz_callback = @expected_release_dir + "/deploy/barbaz.rb"
|
283
296
|
::File.should_receive(:exist?).with(barbaz_callback).and_return(false)
|
297
|
+
::Dir.should_receive(:chdir).with(@expected_release_dir).and_yield
|
284
298
|
@provider.should_not_receive(:from_file)
|
285
299
|
@provider.callback(:barbaz, nil)
|
286
300
|
@provider.converge
|
287
301
|
end
|
288
302
|
|
303
|
+
# CHEF-3449 #converge_by is called in #recipe_eval and must happen in sequence
|
304
|
+
# with the other calls to #converge_by to keep the train on the tracks
|
305
|
+
it "evaluates a callback file before the corresponding step" do
|
306
|
+
::Dir.should_receive(:chdir).with(@expected_release_dir).exactly(4).times.and_yield
|
307
|
+
@provider.should_receive(:verify_directories_exist)
|
308
|
+
@provider.should_receive(:update_cached_repo)
|
309
|
+
@provider.should_receive(:enforce_ownership)
|
310
|
+
@provider.should_receive(:copy_cached_repo)
|
311
|
+
@provider.should_receive(:install_gems)
|
312
|
+
@provider.should_receive(:enforce_ownership)
|
313
|
+
@provider.should_receive(:converge_by).ordered # before_migrate
|
314
|
+
@provider.should_receive(:migrate).ordered
|
315
|
+
@provider.should_receive(:converge_by).ordered # before_symlink
|
316
|
+
@provider.should_receive(:symlink).ordered
|
317
|
+
@provider.should_receive(:converge_by).ordered # before_restart
|
318
|
+
@provider.should_receive(:restart).ordered
|
319
|
+
@provider.should_receive(:converge_by).ordered # after_restart
|
320
|
+
@provider.should_receive(:cleanup!)
|
321
|
+
@provider.deploy
|
322
|
+
end
|
323
|
+
|
289
324
|
it "gets a SCM provider as specified by its resource" do
|
290
325
|
@provider.scm_provider.should be_an_instance_of(Chef::Provider::Git)
|
291
326
|
@provider.scm_provider.new_resource.destination.should eql("/my/deploy/dir/shared/cached-copy")
|
@@ -167,6 +167,12 @@ describe Chef::Provider::HttpRequest do
|
|
167
167
|
@rest.should_receive(:run_request).with(:HEAD, @rest.create_url, @new_resource.headers, false, 10, false)
|
168
168
|
@provider.run_action(:head)
|
169
169
|
end
|
170
|
+
|
171
|
+
it "doesn't call converge_by if HEAD does not return modified" do
|
172
|
+
@rest.should_receive(:run_request).and_return(false)
|
173
|
+
@provider.should_not_receive(:converge_by)
|
174
|
+
@provider.run_action(:head)
|
175
|
+
end
|
170
176
|
end
|
171
177
|
end
|
172
178
|
end
|
metadata
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: -3387315844
|
5
|
+
prerelease: 8
|
6
6
|
segments:
|
7
7
|
- 10
|
8
8
|
- 14
|
9
|
-
-
|
10
|
-
|
9
|
+
- 4
|
10
|
+
- rc
|
11
|
+
- 0
|
12
|
+
version: 10.14.4.rc.0
|
11
13
|
platform: ruby
|
12
14
|
authors:
|
13
15
|
- Adam Jacob
|
@@ -15,7 +17,7 @@ autorequire:
|
|
15
17
|
bindir: bin
|
16
18
|
cert_chain: []
|
17
19
|
|
18
|
-
date: 2012-09-
|
20
|
+
date: 2012-09-24 00:00:00 Z
|
19
21
|
dependencies:
|
20
22
|
- !ruby/object:Gem::Dependency
|
21
23
|
name: mixlib-config
|
@@ -1290,6 +1292,7 @@ files:
|
|
1290
1292
|
- spec/data/cookbooks/openldap/files/default/remotedir/remote_dir_file2.txt
|
1291
1293
|
- spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/remote_subdir_file2.txt
|
1292
1294
|
- spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/remote_subdir_file1.txt
|
1295
|
+
- spec/data/cookbooks/angrybash/recipes/default.rb
|
1293
1296
|
- spec/data/cookbooks/apache2/recipes/default.rb
|
1294
1297
|
- spec/data/cookbooks/apache2/files/default/apache2_module_conf_generate.pl
|
1295
1298
|
- spec/data/cookbooks/java/files/default/java.response
|
@@ -1410,12 +1413,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1410
1413
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1411
1414
|
none: false
|
1412
1415
|
requirements:
|
1413
|
-
- - "
|
1416
|
+
- - ">"
|
1414
1417
|
- !ruby/object:Gem::Version
|
1415
|
-
hash:
|
1418
|
+
hash: 25
|
1416
1419
|
segments:
|
1417
|
-
-
|
1418
|
-
|
1420
|
+
- 1
|
1421
|
+
- 3
|
1422
|
+
- 1
|
1423
|
+
version: 1.3.1
|
1419
1424
|
requirements: []
|
1420
1425
|
|
1421
1426
|
rubyforge_project:
|