chef 11.6.0.rc.1 → 11.6.0.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- 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-shell.1.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 +3 -3
- 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 +3 -3
- data/distro/common/html/knife-exec.1.html +3 -3
- data/distro/common/html/knife-index.1.html +3 -3
- data/distro/common/html/knife-node.1.html +3 -3
- data/distro/common/html/knife-role.1.html +3 -3
- 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 +3 -3
- data/distro/common/html/knife.1.html +3 -3
- data/distro/common/man/man1/chef-shell.1 +1 -1
- 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/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/application/client.rb +0 -2
- data/lib/chef/application/solo.rb +0 -1
- data/lib/chef/application/windows_service.rb +0 -1
- data/lib/chef/client.rb +28 -6
- data/lib/chef/config.rb +1 -1
- data/lib/chef/exceptions.rb +2 -0
- data/lib/chef/knife/cookbook_site_share.rb +1 -0
- data/lib/chef/knife/cookbook_test.rb +1 -0
- data/lib/chef/provider/remote_file/cache_control_data.rb +8 -5
- data/lib/chef/resource_reporter.rb +5 -2
- data/lib/chef/version.rb +1 -1
- data/spec/unit/provider/remote_file/cache_control_data_spec.rb +9 -0
- data/spec/unit/resource_reporter_spec.rb +51 -0
- metadata +2 -2
@@ -87,11 +87,12 @@ class Chef
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def load
|
90
|
-
previous_cc_data = load_data
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
90
|
+
if previous_cc_data = load_data
|
91
|
+
apply(previous_cc_data)
|
92
|
+
self
|
93
|
+
else
|
94
|
+
false
|
95
|
+
end
|
95
96
|
end
|
96
97
|
|
97
98
|
def validate!(current_copy_checksum)
|
@@ -139,6 +140,8 @@ class Chef
|
|
139
140
|
|
140
141
|
def load_data
|
141
142
|
Chef::JSONCompat.from_json(load_json_data)
|
143
|
+
rescue Chef::Exceptions::FileNotFound, Yajl::ParseError
|
144
|
+
false
|
142
145
|
end
|
143
146
|
|
144
147
|
def load_json_data
|
@@ -64,8 +64,11 @@ class Chef
|
|
64
64
|
else
|
65
65
|
#as_hash["result"] = "failed"
|
66
66
|
end
|
67
|
-
|
68
|
-
|
67
|
+
if new_resource.cookbook_name
|
68
|
+
as_hash["cookbook_name"] = new_resource.cookbook_name
|
69
|
+
as_hash["cookbook_version"] = new_resource.cookbook_version.version
|
70
|
+
end
|
71
|
+
|
69
72
|
as_hash
|
70
73
|
end
|
71
74
|
|
data/lib/chef/version.rb
CHANGED
@@ -108,6 +108,15 @@ describe Chef::Provider::RemoteFile::CacheControlData do
|
|
108
108
|
cache_control_data.mtime.should == mtime
|
109
109
|
end
|
110
110
|
end
|
111
|
+
|
112
|
+
context "and the cached checksum data is corrupted" do
|
113
|
+
let(:cache_json_data) { '{"foo",,"bar" []}' }
|
114
|
+
|
115
|
+
it "returns empty cache control data" do
|
116
|
+
cache_control_data.etag.should be_nil
|
117
|
+
cache_control_data.mtime.should be_nil
|
118
|
+
end
|
119
|
+
end
|
111
120
|
end
|
112
121
|
|
113
122
|
describe "when saving to disk" do
|
@@ -413,6 +413,57 @@ describe Chef::ResourceReporter do
|
|
413
413
|
|
414
414
|
end
|
415
415
|
|
416
|
+
context "when new_resource does not have a cookbook_name" do
|
417
|
+
before do
|
418
|
+
@bad_resource = Chef::Resource::File.new("/tmp/a-file.txt")
|
419
|
+
@bad_resource.cookbook_name = nil
|
420
|
+
|
421
|
+
@resource_reporter.resource_action_start(@bad_resource, :create)
|
422
|
+
@resource_reporter.resource_current_state_loaded(@bad_resource, :create, @current_resource)
|
423
|
+
@resource_reporter.resource_updated(@bad_resource, :create)
|
424
|
+
@resource_reporter.resource_completed(@bad_resource)
|
425
|
+
@run_status.stop_clock
|
426
|
+
@report = @resource_reporter.prepare_run_data
|
427
|
+
@first_update_report = @report["resources"].first
|
428
|
+
end
|
429
|
+
|
430
|
+
it "includes an updated resource's initial state" do
|
431
|
+
@first_update_report["before"].should == @current_resource.state
|
432
|
+
end
|
433
|
+
|
434
|
+
it "includes an updated resource's final state" do
|
435
|
+
@first_update_report["after"].should == @new_resource.state
|
436
|
+
end
|
437
|
+
|
438
|
+
it "includes the resource's name" do
|
439
|
+
@first_update_report["name"].should == @new_resource.name
|
440
|
+
end
|
441
|
+
|
442
|
+
it "includes the resource's id attribute" do
|
443
|
+
@first_update_report["id"].should == @new_resource.identity
|
444
|
+
end
|
445
|
+
|
446
|
+
it "includes the elapsed time for the resource to converge" do
|
447
|
+
# TODO: API takes integer number of milliseconds as a string. This
|
448
|
+
# should be an int.
|
449
|
+
@first_update_report.should have_key("duration")
|
450
|
+
@first_update_report["duration"].to_i.should be_within(100).of(0)
|
451
|
+
end
|
452
|
+
|
453
|
+
it "includes the action executed by the resource" do
|
454
|
+
# TODO: rename as "action"
|
455
|
+
@first_update_report["result"].should == "create"
|
456
|
+
end
|
457
|
+
|
458
|
+
it "does not include a cookbook name for the resource" do
|
459
|
+
@first_update_report.should_not have_key("cookbook_name")
|
460
|
+
end
|
461
|
+
|
462
|
+
it "does not include a cookbook version for the resource" do
|
463
|
+
@first_update_report.should_not have_key("cookbook_version")
|
464
|
+
end
|
465
|
+
end
|
466
|
+
|
416
467
|
end
|
417
468
|
|
418
469
|
describe "when updating resource history on the server" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 11.6.0.rc.
|
4
|
+
version: 11.6.0.rc.2
|
5
5
|
prerelease: 7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mixlib-config
|