]>
Commit | Line | Data |
---|---|---|
4e5a0fdf ER |
1 | --- chef-14.1.21/chef-config/lib/chef-config/config.rb.orig 2018-05-21 18:22:54.000000000 +0200 |
2 | +++ chef-14.1.21/chef-config/lib/chef-config/config.rb 2018-07-14 22:03:35.187220811 +0200 | |
3 | @@ -214,7 +214,7 @@ | |
16f49c06 ER |
4 | |
5 | # Location of cookbooks on disk. String or array of strings. | |
6 | # Defaults to <chef_repo_path>/cookbooks. If chef_repo_path | |
7 | - # is not specified, this is set to [/var/chef/cookbooks, /var/chef/site-cookbooks]). | |
8 | + # is not specified, this is set to [/var/lib/chef/cookbooks, /var/lib/chef/site-cookbooks]). | |
9 | default(:cookbook_path) do | |
4e5a0fdf | 10 | if configuration[:chef_repo_path] |
16f49c06 | 11 | derive_path_from_chef_repo_path("cookbooks") |
4e5a0fdf | 12 | @@ -279,9 +279,9 @@ |
16f49c06 ER |
13 | PathHelper.join(config_dir, "local-mode-cache") |
14 | else | |
4e5a0fdf | 15 | primary_cache_root = platform_specific_path("/var") |
16f49c06 ER |
16 | - primary_cache_path = platform_specific_path("/var/chef") |
17 | - # Use /var/chef as the cache path only if that folder exists and we can read and write | |
18 | - # into it, or /var exists and we can read and write into it (we'll create /var/chef later). | |
16f49c06 ER |
19 | + primary_cache_path = platform_specific_path("/var/cache/chef") |
20 | + # Use /var/cache/chef as the cache path only if that folder exists and we can read and write | |
21 | + # into it, or /var exists and we can read and write into it (we'll create /var/cache/chef later). | |
22 | # Otherwise, we'll create .chef under the user's home directory and use that as | |
23 | # the cache path. | |
24 | unless path_accessible?(primary_cache_path) || path_accessible?(primary_cache_root) | |
4e5a0fdf ER |
25 | @@ -303,10 +303,10 @@ |
26 | default(:checksum_path) { PathHelper.join(cache_path, "checksums") } | |
27 | ||
28 | # Where chef's cache files should be stored | |
29 | - default(:file_cache_path) { PathHelper.join(cache_path, "cache") } | |
30 | + default(:file_cache_path) { cache_path } | |
31 | ||
32 | # Where backups of chef-managed files should go | |
33 | - default(:file_backup_path) { PathHelper.join(cache_path, "backup") } | |
34 | + default(:file_backup_path) { "/var/lib/chef/backup" } | |
35 | ||
36 | # The chef-client (or solo) lockfile. | |
37 | # | |
38 | --- chef-14.1.21/chef-config/spec/unit/config_spec.rb.orig 2018-05-21 18:22:54.000000000 +0200 | |
39 | +++ chef-14.1.21/chef-config/spec/unit/config_spec.rb 2018-07-14 22:10:47.642865027 +0200 | |
40 | @@ -252,7 +252,7 @@ | |
41 | if is_windows | |
42 | "#{ChefConfig::Config.env['SYSTEMDRIVE']}\\chef" | |
43 | else | |
44 | - "/var/chef" | |
45 | + "/var/cache/chef" | |
46 | end | |
47 | end | |
48 | ||
49 | @@ -375,34 +375,34 @@ | |
50 | allow(File).to receive(:expand_path).and_return("#{ChefConfig::Config.env["SYSTEMDRIVE"]}/Path/To/Executable") | |
51 | end | |
52 | end | |
53 | - context "when /var/chef exists and is accessible" do | |
54 | - it "defaults to /var/chef" do | |
55 | - allow(ChefConfig::Config).to receive(:path_accessible?).with(to_platform("/var/chef")).and_return(true) | |
56 | + context "when /var/cache/chef exists and is accessible" do | |
57 | + it "defaults to /var/cache/chef" do | |
58 | + allow(ChefConfig::Config).to receive(:path_accessible?).with(to_platform("/var/cache/chef")).and_return(true) | |
59 | expect(ChefConfig::Config[:cache_path]).to eq(primary_cache_path) | |
60 | end | |
61 | end | |
62 | ||
63 | - context "when /var/chef does not exist and /var is accessible" do | |
64 | - it "defaults to /var/chef" do | |
65 | - allow(File).to receive(:exists?).with(to_platform("/var/chef")).and_return(false) | |
66 | - allow(ChefConfig::Config).to receive(:path_accessible?).with(to_platform("/var")).and_return(true) | |
67 | + context "when /var/cache/chef does not exist and /var is accessible" do | |
68 | + it "defaults to /var/cache/chef" do | |
69 | + allow(File).to receive(:exists?).with(to_platform("/var/cache/chef")).and_return(false) | |
70 | + allow(ChefConfig::Config).to receive(:path_accessible?).with(to_platform("/var/cache")).and_return(true) | |
71 | expect(ChefConfig::Config[:cache_path]).to eq(primary_cache_path) | |
72 | end | |
73 | end | |
74 | ||
75 | - context "when /var/chef does not exist and /var is not accessible" do | |
76 | + context "when /var/cache/chef does not exist and /var is not accessible" do | |
77 | it "defaults to $HOME/.chef" do | |
78 | - allow(File).to receive(:exists?).with(to_platform("/var/chef")).and_return(false) | |
79 | - allow(ChefConfig::Config).to receive(:path_accessible?).with(to_platform("/var")).and_return(false) | |
80 | + allow(File).to receive(:exists?).with(to_platform("/var/cache/chef")).and_return(false) | |
81 | + allow(ChefConfig::Config).to receive(:path_accessible?).with(to_platform("/var/cache")).and_return(false) | |
82 | expect(ChefConfig::Config[:cache_path]).to eq(secondary_cache_path) | |
83 | end | |
84 | end | |
85 | ||
86 | - context "when /var/chef exists and is not accessible" do | |
87 | + context "when /var/cache/chef exists and is not accessible" do | |
88 | it "defaults to $HOME/.chef" do | |
89 | - allow(File).to receive(:exists?).with(to_platform("/var/chef")).and_return(true) | |
90 | - allow(File).to receive(:readable?).with(to_platform("/var/chef")).and_return(true) | |
91 | - allow(File).to receive(:writable?).with(to_platform("/var/chef")).and_return(false) | |
92 | + allow(File).to receive(:exists?).with(to_platform("/var/cache/chef")).and_return(true) | |
93 | + allow(File).to receive(:readable?).with(to_platform("/var/cache/chef")).and_return(true) | |
94 | + allow(File).to receive(:writable?).with(to_platform("/var/cache/chef")).and_return(false) | |
95 | ||
96 | expect(ChefConfig::Config[:cache_path]).to eq(secondary_cache_path) | |
97 | end | |
98 | @@ -447,10 +447,8 @@ | |
99 | expect(ChefConfig::Config[:download_progress_interval]).to eq(10) | |
100 | end | |
101 | ||
102 | - it "ChefConfig::Config[:file_backup_path] defaults to /var/chef/backup" do | |
103 | - allow(ChefConfig::Config).to receive(:cache_path).and_return(primary_cache_path) | |
104 | - backup_path = is_windows ? "#{primary_cache_path}\\backup" : "#{primary_cache_path}/backup" | |
105 | - expect(ChefConfig::Config[:file_backup_path]).to eq(backup_path) | |
106 | + it "ChefConfig::Config[:file_backup_path] defaults to /var/lib/chef/backup" do | |
107 | + expect(ChefConfig::Config[:file_backup_path]).to eq("/var/lib/chef/backup") | |
108 | end | |
109 | ||
110 | it "ChefConfig::Config[:ssl_verify_mode] defaults to :verify_peer" do | |
111 | @@ -568,19 +566,19 @@ | |
112 | end | |
113 | end | |
114 | ||
115 | - it "ChefConfig::Config[:data_bag_path] defaults to /var/chef/data_bags" do | |
116 | + it "ChefConfig::Config[:data_bag_path] defaults to /var/cache/chef/data_bags" do | |
117 | allow(ChefConfig::Config).to receive(:cache_path).and_return(primary_cache_path) | |
118 | data_bag_path = is_windows ? "#{primary_cache_path}\\data_bags" : "#{primary_cache_path}/data_bags" | |
119 | expect(ChefConfig::Config[:data_bag_path]).to eq(data_bag_path) | |
120 | end | |
121 | ||
122 | - it "ChefConfig::Config[:environment_path] defaults to /var/chef/environments" do | |
123 | + it "ChefConfig::Config[:environment_path] defaults to /var/cache/chef/environments" do | |
124 | allow(ChefConfig::Config).to receive(:cache_path).and_return(primary_cache_path) | |
125 | environment_path = is_windows ? "#{primary_cache_path}\\environments" : "#{primary_cache_path}/environments" | |
126 | expect(ChefConfig::Config[:environment_path]).to eq(environment_path) | |
127 | end | |
128 | ||
129 | - it "ChefConfig::Config[:cookbook_artifact_path] defaults to /var/chef/cookbook_artifacts" do | |
130 | + it "ChefConfig::Config[:cookbook_artifact_path] defaults to /var/cache/chef/cookbook_artifacts" do | |
131 | allow(ChefConfig::Config).to receive(:cache_path).and_return(primary_cache_path) | |
132 | environment_path = is_windows ? "#{primary_cache_path}\\cookbook_artifacts" : "#{primary_cache_path}/cookbook_artifacts" | |
133 | expect(ChefConfig::Config[:cookbook_artifact_path]).to eq(environment_path) | |
134 | --- chef-14.1.21/lib/chef/handler/json_file.rb~ 2018-05-21 18:22:54.000000000 +0200 | |
135 | +++ chef-14.1.21/lib/chef/handler/json_file.rb 2018-07-14 22:11:41.547750482 +0200 | |
136 | @@ -27,7 +27,7 @@ | |
137 | ||
138 | def initialize(config = {}) | |
139 | @config = config | |
140 | - @config[:path] ||= "/var/chef/reports" | |
141 | + @config[:path] ||= "/var/lib/chef/reports" | |
142 | end | |
143 | ||
144 | def report | |
145 | --- chef-14.1.21/spec/support/shared/context/client.rb~ 2018-05-21 18:22:54.000000000 +0200 | |
146 | +++ chef-14.1.21/spec/support/shared/context/client.rb 2018-07-14 22:12:36.736009017 +0200 | |
147 | @@ -164,7 +164,7 @@ | |
148 | ||
149 | before do | |
150 | Chef::Config[:client_fork] = enable_fork | |
151 | - Chef::Config[:cache_path] = windows? ? 'C:\chef' : "/var/chef" | |
152 | + Chef::Config[:cache_path] = windows? ? 'C:\chef' : "/var/cache/chef" | |
153 | Chef::Config[:why_run] = false | |
154 | Chef::Config[:audit_mode] = :enabled | |
155 | Chef::Config[:chef_guid] = "default-guid" | |
156 | --- chef-14.1.21/spec/support/shared/context/config.rb~ 2018-05-21 18:22:54.000000000 +0200 | |
157 | +++ chef-14.1.21/spec/support/shared/context/config.rb 2018-07-14 22:12:53.026479395 +0200 | |
158 | @@ -13,7 +13,7 @@ | |
159 | # Basic config. Nothing fancy. | |
160 | shared_context "default config options" do | |
161 | before do | |
162 | - Chef::Config[:cache_path] = windows? ? 'C:\chef' : "/var/chef" | |
163 | + Chef::Config[:cache_path] = windows? ? 'C:\chef' : "/var/cache/chef" | |
164 | end | |
165 | ||
166 | # Don't need to have an after block to reset the config... | |
167 | --- chef-14.1.21/spec/unit/application/solo_spec.rb~ 2018-05-21 18:22:54.000000000 +0200 | |
168 | +++ chef-14.1.21/spec/unit/application/solo_spec.rb 2018-07-14 22:13:57.265002987 +0200 | |
169 | @@ -206,10 +206,10 @@ | |
170 | end | |
171 | ||
172 | it "sets the repo path" do | |
173 | - expect(Chef::Config).to receive(:find_chef_repo_path).and_return("/var/chef") | |
174 | + expect(Chef::Config).to receive(:find_chef_repo_path).and_return("/var/lib/chef") | |
175 | app.reconfigure | |
176 | expect(Chef::Config.has_key?(:chef_repo_path)).to be_truthy | |
177 | - expect(Chef::Config[:chef_repo_path]).to eq ("/var/chef") | |
178 | + expect(Chef::Config[:chef_repo_path]).to eq ("/var/lib/chef") | |
179 | end | |
180 | ||
181 | it "runs chef-client in local mode" do | |
182 | --- chef-14.1.21/spec/unit/cookbook/file_vendor_spec.rb~ 2018-05-21 18:22:54.000000000 +0200 | |
183 | +++ chef-14.1.21/spec/unit/cookbook/file_vendor_spec.rb 2018-07-14 22:14:31.759334653 +0200 | |
184 | @@ -75,7 +75,7 @@ | |
185 | ||
186 | context "when configured to load files from disk" do | |
187 | ||
188 | - let(:cookbook_path) { %w{/var/chef/cookbooks /var/chef/other_cookbooks} } | |
189 | + let(:cookbook_path) { %w{/var/lib/chef/cookbooks /var/lib/chef/other_cookbooks} } | |
190 | ||
191 | let(:manifest) do | |
192 | cbv = Chef::CookbookVersion.new("bob", Array(Dir.tmpdir)) | |
193 | --- chef-14.1.21/spec/unit/data_bag_spec.rb~ 2018-05-21 18:22:54.000000000 +0200 | |
194 | +++ chef-14.1.21/spec/unit/data_bag_spec.rb 2018-07-14 22:15:36.734550542 +0200 | |
195 | @@ -243,17 +243,17 @@ | |
196 | ||
197 | expect do | |
198 | Chef::DataBag.load("foo") | |
199 | - end.to raise_error Chef::Exceptions::InvalidDataBagPath, "Data bag path '/var/chef/data_bags' is invalid" | |
200 | + end.to raise_error Chef::Exceptions::InvalidDataBagPath, "Data bag path '/var/cache/chef/data_bags' is invalid" | |
201 | end | |
202 | ||
203 | end | |
204 | ||
205 | describe "data bag with string path" do | |
206 | - it_should_behave_like "data bag in solo mode", "/var/chef/data_bags" | |
207 | + it_should_behave_like "data bag in solo mode", "/var/cache/chef/data_bags" | |
208 | end | |
209 | ||
210 | describe "data bag with array path" do | |
211 | - it_should_behave_like "data bag in solo mode", ["/var/chef/data_bags", "/var/chef/data_bags_2"] | |
212 | + it_should_behave_like "data bag in solo mode", ["/var/cache/chef/data_bags", "/var/cache/chef/data_bags_2"] | |
213 | end | |
214 | end | |
215 | ||
216 | --- chef-14.1.21/spec/unit/environment_spec.rb~ 2018-05-21 18:22:54.000000000 +0200 | |
217 | +++ chef-14.1.21/spec/unit/environment_spec.rb 2018-07-14 22:16:20.332481816 +0200 | |
218 | @@ -393,7 +393,7 @@ | |
219 | describe "in solo mode" do | |
220 | before do | |
221 | Chef::Config[:solo_legacy_mode] = true | |
222 | - Chef::Config[:environment_path] = "/var/chef/environments" | |
223 | + Chef::Config[:environment_path] = "/var/cache/chef/environments" | |
224 | end | |
225 | ||
226 | after do | |
227 | @@ -452,7 +452,7 @@ | |
228 | ||
229 | expect do | |
230 | Chef::Environment.load("foo") | |
231 | - end.to raise_error Chef::Exceptions::InvalidEnvironmentPath, "Environment path '/var/chef/environments' is invalid" | |
232 | + end.to raise_error Chef::Exceptions::InvalidEnvironmentPath, "Environment path '/var/cache/chef/environments' is invalid" | |
233 | end | |
234 | ||
235 | it "should raise an error if the file does not exist" do | |
236 | --- chef-14.1.21/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb~ 2018-05-21 18:22:54.000000000 +0200 | |
237 | +++ chef-14.1.21/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb 2018-07-14 22:17:33.390766108 +0200 | |
238 | @@ -42,7 +42,7 @@ | |
239 | @outputter = Chef::Formatters::IndentableOutputStream.new(@stdout, STDERR) | |
240 | #@outputter = Chef::Formatters::IndentableOutputStream.new(STDOUT, STDERR) | |
241 | ||
242 | - allow(Chef::Config).to receive(:cookbook_path).and_return([ "/var/chef/cache" ]) | |
243 | + allow(Chef::Config).to receive(:cookbook_path).and_return([ "/var/lib/chef" ]) | |
244 | end | |
245 | ||
246 | describe "when explaining an error converging a resource" do | |
247 | @@ -58,8 +58,8 @@ | |
248 | end | |
249 | ||
250 | @trace = [ | |
251 | - "/var/chef/cache/cookbooks/syntax-err/recipes/default.rb:14:in `from_file'", | |
252 | - "/var/chef/cache/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'", | |
253 | + "/var/lib/chef/cookbooks/syntax-err/recipes/default.rb:14:in `from_file'", | |
254 | + "/var/lib/chef/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'", | |
255 | "/usr/local/lib/ruby/gems/chef/lib/chef/client.rb:123:in `run'" # should not display | |
256 | ] | |
257 | @exception = Chef::Exceptions::Package.new("No such package 'non-existing-package'") | |
258 | @@ -70,8 +70,8 @@ | |
259 | ||
260 | it "filters chef core code from the backtrace" do | |
261 | @expected_filtered_trace = [ | |
262 | - "/var/chef/cache/cookbooks/syntax-err/recipes/default.rb:14:in `from_file'", | |
263 | - "/var/chef/cache/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'", | |
264 | + "/var/lib/chef/cookbooks/syntax-err/recipes/default.rb:14:in `from_file'", | |
265 | + "/var/lib/chef/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'", | |
266 | ] | |
267 | ||
268 | expect(@inspector.filtered_bt).to eq(@expected_filtered_trace) | |
269 | --- chef-14.1.21/spec/unit/role_spec.rb~ 2018-05-21 18:22:54.000000000 +0200 | |
270 | +++ chef-14.1.21/spec/unit/role_spec.rb 2018-07-14 22:18:45.421896466 +0200 | |
271 | @@ -252,7 +252,7 @@ | |
272 | ||
273 | describe "when loading from disk" do | |
274 | before do | |
275 | - default_cache_path = windows? ? 'C:\chef' : "/var/chef" | |
276 | + default_cache_path = windows? ? 'C:\chef' : "/var/cache/chef" | |
277 | allow(Chef::Config).to receive(:cache_path).and_return(default_cache_path) | |
278 | end | |
279 | ||
280 | --- chef-14.1.21/spec/unit/run_lock_spec.rb~ 2018-05-21 18:22:54.000000000 +0200 | |
281 | +++ chef-14.1.21/spec/unit/run_lock_spec.rb 2018-07-14 22:19:37.309448017 +0200 | |
282 | @@ -20,8 +20,8 @@ | |
283 | ||
284 | describe Chef::RunLock do | |
285 | ||
286 | - default_cache_path = windows? ? 'C:\chef' : "/var/chef" | |
287 | - default_pid_location = windows? ? 'C:\chef\cache\chef-client-running.pid' : "/var/chef/cache/chef-client-running.pid" | |
288 | + default_cache_path = windows? ? 'C:\chef' : "/var/cache/chef" | |
289 | + default_pid_location = windows? ? 'C:\chef\cache\chef-client-running.pid' : "/var/cache/chef/chef-client-running.pid" | |
290 | ||
291 | describe "when first created" do | |
292 | it "locates the lockfile in the file cache path by default" do |