chef 10.14.0.rc.1 → 10.14.0.rc.2
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 +4 -4
- data/distro/common/html/chef-expander.8.html +4 -4
- data/distro/common/html/chef-expanderctl.8.html +4 -4
- data/distro/common/html/chef-server-webui.8.html +4 -4
- data/distro/common/html/chef-server.8.html +4 -4
- data/distro/common/html/chef-solo.8.html +4 -4
- data/distro/common/html/chef-solr.8.html +4 -4
- data/distro/common/html/knife-bootstrap.1.html +5 -5
- data/distro/common/html/knife-client.1.html +5 -5
- data/distro/common/html/knife-configure.1.html +4 -4
- data/distro/common/html/knife-cookbook-site.1.html +7 -7
- data/distro/common/html/knife-cookbook.1.html +8 -8
- data/distro/common/html/knife-data-bag.1.html +4 -4
- data/distro/common/html/knife-environment.1.html +7 -7
- data/distro/common/html/knife-exec.1.html +5 -5
- data/distro/common/html/knife-index.1.html +5 -5
- data/distro/common/html/knife-node.1.html +5 -5
- data/distro/common/html/knife-role.1.html +7 -7
- data/distro/common/html/knife-search.1.html +4 -4
- data/distro/common/html/knife-ssh.1.html +4 -4
- data/distro/common/html/knife-status.1.html +5 -5
- data/distro/common/html/knife-tag.1.html +4 -4
- data/distro/common/html/knife.1.html +4 -4
- data/distro/common/html/shef.1.html +4 -4
- 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/application/client.rb +6 -0
- data/lib/chef/config.rb +5 -1
- data/lib/chef/knife/ssh.rb +2 -3
- data/lib/chef/provider/file.rb +55 -23
- data/lib/chef/provider/package.rb +0 -1
- data/lib/chef/provider/service/freebsd.rb +2 -2
- data/lib/chef/provider/service/redhat.rb +1 -1
- data/lib/chef/provider/service/upstart.rb +4 -4
- data/lib/chef/resource/file.rb +10 -0
- data/lib/chef/resource_reporter.rb +22 -13
- data/lib/chef/version.rb +1 -1
- data/spec/unit/provider/file_spec.rb +129 -3
- data/spec/unit/provider/remote_file_spec.rb +7 -0
- data/spec/unit/provider/service/freebsd_service_spec.rb +38 -10
- data/spec/unit/provider/service/redhat_spec.rb +47 -46
- 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
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
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
|
-
|
111
|
-
|
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:
|
4
|
+
hash: 3302599623
|
5
5
|
prerelease: 8
|
6
6
|
segments:
|
7
7
|
- 10
|
8
8
|
- 14
|
9
9
|
- 0
|
10
10
|
- rc
|
11
|
-
-
|
12
|
-
version: 10.14.0.rc.
|
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-
|
20
|
+
date: 2012-09-06 00:00:00 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: mixlib-config
|