chef 10.14.0.rc.1 → 10.14.0.rc.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/distro/common/html/chef-client.8.html +4 -4
  2. data/distro/common/html/chef-expander.8.html +4 -4
  3. data/distro/common/html/chef-expanderctl.8.html +4 -4
  4. data/distro/common/html/chef-server-webui.8.html +4 -4
  5. data/distro/common/html/chef-server.8.html +4 -4
  6. data/distro/common/html/chef-solo.8.html +4 -4
  7. data/distro/common/html/chef-solr.8.html +4 -4
  8. data/distro/common/html/knife-bootstrap.1.html +5 -5
  9. data/distro/common/html/knife-client.1.html +5 -5
  10. data/distro/common/html/knife-configure.1.html +4 -4
  11. data/distro/common/html/knife-cookbook-site.1.html +7 -7
  12. data/distro/common/html/knife-cookbook.1.html +8 -8
  13. data/distro/common/html/knife-data-bag.1.html +4 -4
  14. data/distro/common/html/knife-environment.1.html +7 -7
  15. data/distro/common/html/knife-exec.1.html +5 -5
  16. data/distro/common/html/knife-index.1.html +5 -5
  17. data/distro/common/html/knife-node.1.html +5 -5
  18. data/distro/common/html/knife-role.1.html +7 -7
  19. data/distro/common/html/knife-search.1.html +4 -4
  20. data/distro/common/html/knife-ssh.1.html +4 -4
  21. data/distro/common/html/knife-status.1.html +5 -5
  22. data/distro/common/html/knife-tag.1.html +4 -4
  23. data/distro/common/html/knife.1.html +4 -4
  24. data/distro/common/html/shef.1.html +4 -4
  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/application/client.rb +6 -0
  50. data/lib/chef/config.rb +5 -1
  51. data/lib/chef/knife/ssh.rb +2 -3
  52. data/lib/chef/provider/file.rb +55 -23
  53. data/lib/chef/provider/package.rb +0 -1
  54. data/lib/chef/provider/service/freebsd.rb +2 -2
  55. data/lib/chef/provider/service/redhat.rb +1 -1
  56. data/lib/chef/provider/service/upstart.rb +4 -4
  57. data/lib/chef/resource/file.rb +10 -0
  58. data/lib/chef/resource_reporter.rb +22 -13
  59. data/lib/chef/version.rb +1 -1
  60. data/spec/unit/provider/file_spec.rb +129 -3
  61. data/spec/unit/provider/remote_file_spec.rb +7 -0
  62. data/spec/unit/provider/service/freebsd_service_spec.rb +38 -10
  63. data/spec/unit/provider/service/redhat_spec.rb +47 -46
  64. metadata +4 -4
@@ -19,6 +19,27 @@
19
19
  require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "spec_helper"))
20
20
  require 'ostruct'
21
21
 
22
+ shared_examples_for "define_resource_requirements_common" do
23
+ it "should raise an error if /sbin/chkconfig does not exist" do
24
+ File.stub!(:exists?).with("/sbin/chkconfig").and_return(false)
25
+ @provider.stub!(:shell_out).with("/sbin/service chef status").and_raise(Errno::ENOENT)
26
+ @provider.stub!(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_raise(Errno::ENOENT)
27
+ @provider.load_current_resource
28
+ @provider.define_resource_requirements
29
+ lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
30
+ end
31
+
32
+ it "should not raise an error if the service exists but is not added to any runlevels" do
33
+ status = mock("Status", :exitstatus => 0, :stdout => "" , :stderr => "")
34
+ @provider.should_receive(:shell_out).with("/sbin/service chef status").and_return(status)
35
+ chkconfig = mock("Chkconfig", :exitstatus => 0, :stdout => "", :stderr => "service chef supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add chef')")
36
+ @provider.should_receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig)
37
+ @provider.load_current_resource
38
+ @provider.define_resource_requirements
39
+ lambda { @provider.process_resource_requirements }.should_not raise_error
40
+ end
41
+ end
42
+
22
43
  describe "Chef::Provider::Service::Redhat" do
23
44
 
24
45
  before(:each) do
@@ -65,34 +86,31 @@ describe "Chef::Provider::Service::Redhat" do
65
86
  end
66
87
 
67
88
  describe "define resource requirements" do
89
+ it_should_behave_like "define_resource_requirements_common"
68
90
 
69
- it "should raise an error if /sbin/chkconfig does not exist" do
70
- File.stub!(:exists?).with("/sbin/chkconfig").and_return(false)
71
- @provider.stub!(:shell_out).with("/sbin/service chef status").and_raise(Errno::ENOENT)
72
- @provider.stub!(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_raise(Errno::ENOENT)
73
- @provider.load_current_resource
74
- @provider.define_resource_requirements
75
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
76
- end
77
-
78
- it "should raise an error if the service does not exist" do
79
- status = mock("Status", :exitstatus => 1, :stdout => "", :stderr => "chef: unrecognized service")
80
- @provider.should_receive(:shell_out).with("/sbin/service chef status").and_return(status)
81
- chkconfig = mock("Chkconfig", :existatus=> 1, :stdout => "", :stderr => "error reading information on service chef: No such file or directory")
82
- @provider.should_receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig)
83
- @provider.load_current_resource
84
- @provider.define_resource_requirements
85
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
86
- end
87
-
88
- it "should not raise an error if the service exists but is not added to any runlevels" do
89
- status = mock("Status", :exitstatus => 0, :stdout => "" , :stderr => "")
90
- @provider.should_receive(:shell_out).with("/sbin/service chef status").and_return(status)
91
- chkconfig = mock("Chkconfig", :exitstatus => 0, :stdout => "", :stderr => "service chef supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add chef')")
92
- @provider.should_receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig)
93
- @provider.load_current_resource
94
- @provider.define_resource_requirements
95
- lambda { @provider.process_resource_requirements }.should_not raise_error
91
+ context "when the service does not exist" do
92
+ before do
93
+ status = mock("Status", :exitstatus => 1, :stdout => "", :stderr => "chef: unrecognized service")
94
+ @provider.should_receive(:shell_out).with("/sbin/service chef status").and_return(status)
95
+ chkconfig = mock("Chkconfig", :existatus=> 1, :stdout => "", :stderr => "error reading information on service chef: No such file or directory")
96
+ @provider.should_receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig)
97
+ @provider.load_current_resource
98
+ @provider.define_resource_requirements
99
+ end
100
+
101
+ [ "start", "reload", "restart", "enable" ].each do |action|
102
+ it "should raise an error when the action is #{action}" do
103
+ @provider.action = action
104
+ lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
105
+ end
106
+ end
107
+
108
+ [ "stop", "disable" ].each do |action|
109
+ it "should not raise an error when the action is #{action}" do
110
+ @provider.action = action
111
+ lambda { @provider.process_resource_requirements }.should_not raise_error
112
+ end
113
+ end
96
114
  end
97
115
  end
98
116
  end
@@ -107,15 +125,8 @@ describe "Chef::Provider::Service::Redhat" do
107
125
  end
108
126
 
109
127
  describe "define resource requirements" do
110
- it "should raise an error if /sbin/chkconfig does not exist" do
111
- File.stub!(:exists?).with("/sbin/chkconfig").and_return(false)
112
- @provider.stub!(:shell_out).with("/sbin/service chef status").and_raise(Errno::ENOENT)
113
- @provider.stub!(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_raise(Errno::ENOENT)
114
- @provider.load_current_resource
115
- @provider.define_resource_requirements
116
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
117
- end
118
-
128
+ it_should_behave_like "define_resource_requirements_common"
129
+
119
130
  it "should not raise an error if the service does not exist" do
120
131
  status = mock("Status", :exitstatus => 1, :stdout => "", :stderr => "chef: unrecognized service")
121
132
  @provider.should_receive(:shell_out).with("/sbin/service chef status").and_return(status)
@@ -125,16 +136,6 @@ describe "Chef::Provider::Service::Redhat" do
125
136
  @provider.define_resource_requirements
126
137
  lambda { @provider.process_resource_requirements }.should_not raise_error
127
138
  end
128
-
129
- it "should not raise an error if the service exists but is not added to any runlevels" do
130
- status = mock("Status", :exitstatus => 0, :stdout => "" , :stderr => "")
131
- @provider.should_receive(:shell_out).with("/sbin/service chef status").and_return(status)
132
- chkconfig = mock("Chkconfig", :exitstatus => 0, :stdout => "", :stderr => "service chef supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add chef')")
133
- @provider.should_receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig)
134
- @provider.load_current_resource
135
- @provider.define_resource_requirements
136
- lambda { @provider.process_resource_requirements }.should_not raise_error
137
- end
138
139
  end
139
140
  end
140
141
 
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: 3088687561
4
+ hash: 3302599623
5
5
  prerelease: 8
6
6
  segments:
7
7
  - 10
8
8
  - 14
9
9
  - 0
10
10
  - rc
11
- - 1
12
- version: 10.14.0.rc.1
11
+ - 2
12
+ version: 10.14.0.rc.2
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-28 00:00:00 Z
20
+ date: 2012-09-06 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: mixlib-config