chef 10.14.0.rc.0 → 10.14.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/distro/common/html/chef-client.8.html +3 -3
  2. data/distro/common/html/chef-expander.8.html +3 -3
  3. data/distro/common/html/chef-expanderctl.8.html +3 -3
  4. data/distro/common/html/chef-server-webui.8.html +3 -3
  5. data/distro/common/html/chef-server.8.html +3 -3
  6. data/distro/common/html/chef-solo.8.html +3 -3
  7. data/distro/common/html/chef-solr.8.html +3 -3
  8. data/distro/common/html/knife-bootstrap.1.html +4 -4
  9. data/distro/common/html/knife-client.1.html +3 -3
  10. data/distro/common/html/knife-configure.1.html +4 -4
  11. data/distro/common/html/knife-cookbook-site.1.html +3 -3
  12. data/distro/common/html/knife-cookbook.1.html +7 -7
  13. data/distro/common/html/knife-data-bag.1.html +3 -3
  14. data/distro/common/html/knife-environment.1.html +6 -6
  15. data/distro/common/html/knife-exec.1.html +4 -4
  16. data/distro/common/html/knife-index.1.html +4 -4
  17. data/distro/common/html/knife-node.1.html +4 -4
  18. data/distro/common/html/knife-role.1.html +3 -3
  19. data/distro/common/html/knife-search.1.html +5 -5
  20. data/distro/common/html/knife-ssh.1.html +3 -3
  21. data/distro/common/html/knife-status.1.html +3 -3
  22. data/distro/common/html/knife-tag.1.html +4 -4
  23. data/distro/common/html/knife.1.html +3 -3
  24. data/distro/common/html/shef.1.html +7 -7
  25. data/distro/common/man/man1/knife-bootstrap.1 +1 -1
  26. data/distro/common/man/man1/knife-client.1 +1 -1
  27. data/distro/common/man/man1/knife-configure.1 +1 -1
  28. data/distro/common/man/man1/knife-cookbook-site.1 +1 -1
  29. data/distro/common/man/man1/knife-cookbook.1 +1 -1
  30. data/distro/common/man/man1/knife-data-bag.1 +1 -1
  31. data/distro/common/man/man1/knife-environment.1 +1 -1
  32. data/distro/common/man/man1/knife-exec.1 +1 -1
  33. data/distro/common/man/man1/knife-index.1 +1 -1
  34. data/distro/common/man/man1/knife-node.1 +1 -1
  35. data/distro/common/man/man1/knife-role.1 +1 -1
  36. data/distro/common/man/man1/knife-search.1 +1 -1
  37. data/distro/common/man/man1/knife-ssh.1 +1 -1
  38. data/distro/common/man/man1/knife-status.1 +1 -1
  39. data/distro/common/man/man1/knife-tag.1 +1 -1
  40. data/distro/common/man/man1/knife.1 +1 -1
  41. data/distro/common/man/man1/shef.1 +1 -1
  42. data/distro/common/man/man8/chef-client.8 +1 -1
  43. data/distro/common/man/man8/chef-expander.8 +1 -1
  44. data/distro/common/man/man8/chef-expanderctl.8 +1 -1
  45. data/distro/common/man/man8/chef-server-webui.8 +1 -1
  46. data/distro/common/man/man8/chef-server.8 +1 -1
  47. data/distro/common/man/man8/chef-solo.8 +1 -1
  48. data/distro/common/man/man8/chef-solr.8 +1 -1
  49. data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +2 -1
  50. data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +2 -1
  51. data/lib/chef/knife/cookbook_site_share.rb +1 -1
  52. data/lib/chef/knife/ssh.rb +1 -0
  53. data/lib/chef/provider/package.rb +2 -0
  54. data/lib/chef/provider/package/rubygems.rb +5 -0
  55. data/lib/chef/scan_access_control.rb +10 -2
  56. data/lib/chef/version.rb +1 -1
  57. data/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +29 -4
  58. data/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +13 -2
  59. data/spec/unit/knife/cookbook_site_share_spec.rb +1 -1
  60. data/spec/unit/provider/cookbook_file_spec.rb +4 -0
  61. data/spec/unit/resource_reporter_spec.rb +3 -0
  62. data/spec/unit/scan_access_control_spec.rb +16 -5
  63. metadata +4 -4
@@ -17,7 +17,7 @@
17
17
 
18
18
  class Chef
19
19
  CHEF_ROOT = File.dirname(File.expand_path(File.dirname(__FILE__)))
20
- VERSION = '10.14.0.rc.0'
20
+ VERSION = '10.14.0.rc.1'
21
21
  end
22
22
 
23
23
  # NOTE: the Chef::Version class is defined in version_class.rb
@@ -40,20 +40,45 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do
40
40
  before do
41
41
  @node_name = "test-node.example.com"
42
42
  @description = Chef::Formatters::ErrorDescription.new("Error Evaluating File:")
43
+ @exception = NoMethodError.new("undefined method `this_is_not_a_valid_method' for Chef::Resource::File")
44
+
43
45
  @outputter = Chef::Formatters::Outputter.new(StringIO.new, STDERR)
44
46
  #@outputter = Chef::Formatters::Outputter.new(STDOUT, STDERR)
47
+ end
48
+
49
+ describe "when scrubbing backtraces" do
50
+ it "shows backtrace lines from cookbook files" do
51
+ # Error inspector originally used file_cache_path which is incorrect on
52
+ # chef-solo. Using cookbook_path should do the right thing for client and
53
+ # solo.
54
+ Chef::Config.stub!(:cookbook_path).and_return([ "/home/someuser/dev-laptop/cookbooks" ])
55
+ @trace = [
56
+ "/home/someuser/dev-laptop/cookbooks/syntax-err/recipes/default.rb:14:in `from_file'",
57
+ "/home/someuser/dev-laptop/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'",
58
+ "/home/someuser/.multiruby/gems/chef/lib/chef/client.rb:123:in `run'"
59
+ ]
60
+ @exception.set_backtrace(@trace)
61
+ @path = "/var/chef/cache/cookbooks/syntax-err/recipes/default.rb"
62
+ @inspector = described_class.new(@path, @exception)
45
63
 
46
- Chef::Config.stub!(:file_cache_path).and_return("/var/chef/cache")
64
+ @expected_filtered_trace = [
65
+ "/home/someuser/dev-laptop/cookbooks/syntax-err/recipes/default.rb:14:in `from_file'",
66
+ "/home/someuser/dev-laptop/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'",
67
+ ]
68
+ @inspector.filtered_bt.should == @expected_filtered_trace
69
+ end
47
70
  end
48
71
 
49
72
  describe "when explaining an error in the compile phase" do
50
73
  before do
51
- IO.should_receive(:readlines).with("/var/chef/cache/cookbooks/syntax-err/recipes/default.rb").and_return(BAD_RECIPE.split("\n"))
74
+ Chef::Config.stub!(:cookbook_path).and_return([ "/var/chef/cache/cookbooks" ])
75
+ recipe_lines = BAD_RECIPE.split("\n").map {|l| l << "\n" }
76
+ IO.should_receive(:readlines).with("/var/chef/cache/cookbooks/syntax-err/recipes/default.rb").and_return(recipe_lines)
52
77
  @trace = [
53
78
  "/var/chef/cache/cookbooks/syntax-err/recipes/default.rb:14:in `from_file'",
54
- "/var/chef/cache/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'"
79
+ "/var/chef/cache/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'",
80
+ "/usr/local/lib/ruby/gems/chef/lib/chef/client.rb:123:in `run'" # should not display
55
81
  ]
56
- @exception = NoMethodError.new("undefined method `this_is_not_a_valid_method' for Chef::Resource::File")
57
82
  @exception.set_backtrace(@trace)
58
83
  @path = "/var/chef/cache/cookbooks/syntax-err/recipes/default.rb"
59
84
  @inspector = described_class.new(@path, @exception)
@@ -36,7 +36,8 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do
36
36
  @description = Chef::Formatters::ErrorDescription.new("Error Converging Resource:")
37
37
  @outputter = Chef::Formatters::Outputter.new(StringIO.new, STDERR)
38
38
  #@outputter = Chef::Formatters::Outputter.new(STDOUT, STDERR)
39
- Chef::Config.stub!(:file_cache_path).and_return("/var/chef/cache")
39
+
40
+ Chef::Config.stub!(:cookbook_path).and_return([ "/var/chef/cache" ])
40
41
  end
41
42
 
42
43
  describe "when explaining an error converging a resource" do
@@ -54,7 +55,8 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do
54
55
 
55
56
  @trace = [
56
57
  "/var/chef/cache/cookbooks/syntax-err/recipes/default.rb:14:in `from_file'",
57
- "/var/chef/cache/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'"
58
+ "/var/chef/cache/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'",
59
+ "/usr/local/lib/ruby/gems/chef/lib/chef/client.rb:123:in `run'" # should not display
58
60
  ]
59
61
  @exception = Chef::Exceptions::Package.new("No such package 'non-existing-package'")
60
62
  @exception.set_backtrace(@trace)
@@ -62,6 +64,15 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do
62
64
  @inspector.add_explanation(@description)
63
65
  end
64
66
 
67
+ it "filters chef core code from the backtrace" do
68
+ @expected_filtered_trace = [
69
+ "/var/chef/cache/cookbooks/syntax-err/recipes/default.rb:14:in `from_file'",
70
+ "/var/chef/cache/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'",
71
+ ]
72
+
73
+ @inspector.filtered_bt.should == @expected_filtered_trace
74
+ end
75
+
65
76
  it "prints a pretty message" do
66
77
  @description.display(@outputter)
67
78
  end
@@ -36,7 +36,7 @@ describe Chef::Knife::CookbookSiteShare do
36
36
 
37
37
  @cookbook_uploader = Chef::CookbookUploader.new('herpderp', File.join(CHEF_SPEC_DATA, 'cookbooks'), :rest => "norest")
38
38
  Chef::CookbookUploader.stub!(:new).and_return(@cookbook_uploader)
39
- @cookbook_uploader.stub!(:validate_cookbook).and_return(true)
39
+ @cookbook_uploader.stub!(:validate_cookbooks).and_return(true)
40
40
  Chef::CookbookSiteStreamingUploader.stub!(:create_build_dir).and_return(Dir.mktmpdir)
41
41
 
42
42
  Chef::Mixin::Command.stub(:run_command).and_return(true)
@@ -180,6 +180,10 @@ EXPECTED
180
180
  before do
181
181
  Chef::FileAccessControl.any_instance.stub(:modified?).and_return(false)
182
182
  @tempfile = Tempfile.open('cookbook_file_spec')
183
+ # CHEF-2991: We handle CRLF very poorly and we don't know what line endings
184
+ # our source file is going to have, so we use binary mode to preserve CRLF if needed.
185
+ source_file = CHEF_SPEC_DATA + "/cookbooks/apache2/files/default/apache2_module_conf_generate.pl"
186
+ @tempfile.binmode unless File.open(source_file, "rb") { |f| f.read =~ /\r/ }
183
187
  @new_resource.path(@target_file = @tempfile.path)
184
188
  @tempfile.write(@file_content)
185
189
  @tempfile.close
@@ -85,6 +85,7 @@ describe Chef::ResourceReporter do
85
85
  context "when a resource fails before loading current state" do
86
86
  before do
87
87
  @exception = Exception.new
88
+ @exception.set_backtrace(caller)
88
89
  @resource_reporter.resource_action_start(@new_resource, :create)
89
90
  @resource_reporter.resource_failed(@new_resource, :create, @exception)
90
91
  @resource_reporter.resource_completed(@new_resource)
@@ -148,6 +149,7 @@ describe Chef::ResourceReporter do
148
149
  before do
149
150
  @next_new_resource = Chef::Resource::Service.new("apache2")
150
151
  @exception = Exception.new
152
+ @exception.set_backtrace(caller)
151
153
  @resource_reporter.resource_failed(@next_new_resource, :create, @exception)
152
154
  @resource_reporter.resource_completed(@next_new_resource)
153
155
  end
@@ -203,6 +205,7 @@ describe Chef::ResourceReporter do
203
205
  context "and the resource failed to converge" do
204
206
  before do
205
207
  @exception = Exception.new
208
+ @exception.set_backtrace(caller)
206
209
  @resource_reporter.resource_failed(@new_resource, :create, @exception)
207
210
  @resource_reporter.resource_completed(@new_resource)
208
211
  end
@@ -63,14 +63,25 @@ describe Chef::ScanAccessControl do
63
63
  @current_resource.mode.should == "644"
64
64
  end
65
65
 
66
- it "sets the group of the current resource to the current group as a String" do
67
- @current_resource.group.should == Etc.getgrgid(0).name
66
+ context "on unix", :unix_only do
67
+ it "sets the group of the current resource to the current group as a String" do
68
+ @current_resource.group.should == Etc.getgrgid(0).name
69
+ end
70
+
71
+ it "sets the owner of the current resource to the current owner as a String" do
72
+ @current_resource.user.should == "root"
73
+ end
68
74
  end
69
75
 
70
- it "sets the owner of the current resource to the current owner as a String" do
71
- @current_resource.user.should == "root"
76
+ context "on windows", :windows_only do
77
+ it "sets the group of the current resource to the current group as a String" do
78
+ @current_resource.group.should == 0
79
+ end
80
+
81
+ it "sets the owner of the current resource to the current owner as a String" do
82
+ @current_resource.user.should == 0
83
+ end
72
84
  end
73
-
74
85
  end
75
86
 
76
87
  describe "when new_resource specifies the mode with a string" do
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef
3
3
  version: !ruby/object:Gem::Version
4
- hash: 932825029
4
+ hash: 3088687561
5
5
  prerelease: 8
6
6
  segments:
7
7
  - 10
8
8
  - 14
9
9
  - 0
10
10
  - rc
11
- - 0
12
- version: 10.14.0.rc.0
11
+ - 1
12
+ version: 10.14.0.rc.1
13
13
  platform: ruby
14
14
  authors:
15
15
  - Adam Jacob
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2012-08-21 00:00:00 Z
20
+ date: 2012-08-28 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: mixlib-config