chef 13.10.0 → 13.10.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 755e33dfeebb4f7feb8c20fe62c5149cf80e379a
4
- data.tar.gz: dd6572e44c36e13278ed9ea09fe43733a70de874
3
+ metadata.gz: 07f498ba61d7d87850edd566e87e5942aee2480c
4
+ data.tar.gz: 0faa34027b9c99b7ca406925b0da04b8d7fc4b6c
5
5
  SHA512:
6
- metadata.gz: 6c88eaa977890d5d3e06a6ec083153827b894117fa37ef45cf29936c745fbf5e765da56970903bd39964c7004a705c71d20883f2c51282902142a68421e0bb86
7
- data.tar.gz: dddf42b637ced664c9e9d48c578c49039b28f43e9a1cd7846e2fee4d158da838c42e7752701fe64e806f2ed31b3b5d35a1af261134b14355cf35b6544e0e152a
6
+ metadata.gz: 78d41a3824835af322fd9657639e49db6db2d41e0ed59add5a661af8ae498495b0c8b411f80d79e2447447a23d3d84aca8d66da75f442e4c160ce3bfae9977e6
7
+ data.tar.gz: 043a6e1077f34577914b6217454d07b8ed2bc82e65db65c84f59c1d1465baf866dc1e8cea6f5440ce6e073aadd675b52015c8cdfee7248ab48ee14ac8aa4cf3c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 13.10.0
1
+ 13.10.4
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
40
40
  s.add_dependency "iso8601", "~> 0.9.1"
41
41
 
42
42
  # Audit mode requires these, so they are non-developmental dependencies now
43
- %w{rspec-core rspec-expectations rspec-mocks}.each { |gem| s.add_dependency gem, "~> 3.5" }
43
+ %w{rspec-core rspec-expectations rspec-mocks}.each { |gem| s.add_dependency gem, "~> 3.5", "< 3.8" }
44
44
  s.add_dependency "rspec_junit_formatter", "~> 0.2.0"
45
45
  s.add_dependency "serverspec", "~> 2.7"
46
46
  s.add_dependency "specinfra", "~> 2.10"
@@ -529,14 +529,14 @@ class Chef::Application::Client < Chef::Application
529
529
 
530
530
  def fetch_recipe_tarball(url, path)
531
531
  Chef::Log.debug("Download recipes tarball from #{url} to #{path}")
532
- if url =~ URI.regexp
532
+ if File.exist?(url)
533
+ FileUtils.cp(url, path)
534
+ elsif url =~ URI.regexp
533
535
  File.open(path, "wb") do |f|
534
536
  open(url) do |r|
535
537
  f.write(r.read)
536
538
  end
537
539
  end
538
- elsif File.exist?(url)
539
- FileUtils.cp(url, path)
540
540
  else
541
541
  Chef::Application.fatal! "You specified --recipe-url but the value is neither a valid URL nor a path to a file that exists on disk." +
542
542
  "Please confirm the location of the tarball and try again."
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Lamont Granquist (<lamont@chef.io>)
3
- # Copyright:: Copyright 2013-2016, Chef Software Inc.
3
+ # Copyright:: Copyright 2013-2018, Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -68,7 +68,7 @@ class Chef
68
68
  # the leading "[.]chef-" here should be considered a public API and should not be changed
69
69
  basename.insert 0, "chef-"
70
70
  basename.insert 0, "." unless Chef::Platform.windows? # dotfile if we're not on windows
71
- basename
71
+ basename.scrub
72
72
  end
73
73
 
74
74
  # this is similar to File.extname() but greedy about the extension (from the first dot, not the last dot)
@@ -76,7 +76,7 @@ class Chef
76
76
  # complexity here is due to supporting mangling non-UTF8 strings (e.g. latin-1 filenames with characters that are illegal in UTF-8)
77
77
  b = File.basename(@new_resource.path)
78
78
  i = b.index(".")
79
- i.nil? ? "" : b[i..-1]
79
+ i.nil? ? "" : b[i..-1].scrub
80
80
  end
81
81
 
82
82
  # Returns the possible directories for the tempfile to be created in.
@@ -39,6 +39,14 @@ class Chef
39
39
  a.assertion { new_resource.source || msi? }
40
40
  a.failure_message Chef::Exceptions::NoWindowsPackageSource, "Source for package #{new_resource.name} must be specified in the resource's source property for package to be installed because the package_name property is used to test for the package installation state for this package type."
41
41
  end
42
+
43
+ unless uri_scheme?(new_resource.source)
44
+ requirements.assert(:install) do |a|
45
+ a.assertion { ::File.exist?(new_resource.source) }
46
+ a.failure_message Chef::Exceptions::Package, "Source for package #{new_resource.name} does not exist"
47
+ a.whyrun "Assuming source file #{new_resource.source} would have been created."
48
+ end
49
+ end
42
50
  end
43
51
 
44
52
  # load_current_resource is run in Chef::Provider#run_action when not in whyrun_mode?
@@ -23,7 +23,7 @@ require "chef/version_string"
23
23
 
24
24
  class Chef
25
25
  CHEF_ROOT = File.expand_path("../..", __FILE__)
26
- VERSION = Chef::VersionString.new("13.10.0")
26
+ VERSION = Chef::VersionString.new("13.10.4")
27
27
  end
28
28
 
29
29
  #
@@ -394,6 +394,25 @@ describe Chef::Provider::Package::Windows, :windows_only do
394
394
  end
395
395
  end
396
396
  end
397
+
398
+ context "a missing local file is given" do
399
+ let(:resource_source) { "C:/a_missing_file.exe" }
400
+ let(:installer_type) { nil }
401
+ before do
402
+ allow(::File).to receive(:exist?).with(provider.new_resource.source).and_return(false)
403
+ provider.load_current_resource
404
+ end
405
+
406
+ it "raises a Package error" do
407
+ expect { provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package)
408
+ end
409
+
410
+ it "why_run mode doesn't raise an error" do
411
+ Chef::Config[:why_run] = true
412
+ expect { provider.run_action(:install) }.not_to raise_error
413
+ Chef::Config[:why_run] = false
414
+ end
415
+ end
397
416
  end
398
417
 
399
418
  shared_context "valid checksum" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.10.0
4
+ version: 13.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-11 00:00:00.000000000 Z
11
+ date: 2018-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-config
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 13.10.0
19
+ version: 13.10.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 13.10.0
26
+ version: 13.10.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mixlib-cli
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -313,6 +313,9 @@ dependencies:
313
313
  - - "~>"
314
314
  - !ruby/object:Gem::Version
315
315
  version: '3.5'
316
+ - - "<"
317
+ - !ruby/object:Gem::Version
318
+ version: '3.8'
316
319
  type: :runtime
317
320
  prerelease: false
318
321
  version_requirements: !ruby/object:Gem::Requirement
@@ -320,6 +323,9 @@ dependencies:
320
323
  - - "~>"
321
324
  - !ruby/object:Gem::Version
322
325
  version: '3.5'
326
+ - - "<"
327
+ - !ruby/object:Gem::Version
328
+ version: '3.8'
323
329
  - !ruby/object:Gem::Dependency
324
330
  name: rspec-expectations
325
331
  requirement: !ruby/object:Gem::Requirement
@@ -327,6 +333,9 @@ dependencies:
327
333
  - - "~>"
328
334
  - !ruby/object:Gem::Version
329
335
  version: '3.5'
336
+ - - "<"
337
+ - !ruby/object:Gem::Version
338
+ version: '3.8'
330
339
  type: :runtime
331
340
  prerelease: false
332
341
  version_requirements: !ruby/object:Gem::Requirement
@@ -334,6 +343,9 @@ dependencies:
334
343
  - - "~>"
335
344
  - !ruby/object:Gem::Version
336
345
  version: '3.5'
346
+ - - "<"
347
+ - !ruby/object:Gem::Version
348
+ version: '3.8'
337
349
  - !ruby/object:Gem::Dependency
338
350
  name: rspec-mocks
339
351
  requirement: !ruby/object:Gem::Requirement
@@ -341,6 +353,9 @@ dependencies:
341
353
  - - "~>"
342
354
  - !ruby/object:Gem::Version
343
355
  version: '3.5'
356
+ - - "<"
357
+ - !ruby/object:Gem::Version
358
+ version: '3.8'
344
359
  type: :runtime
345
360
  prerelease: false
346
361
  version_requirements: !ruby/object:Gem::Requirement
@@ -348,6 +363,9 @@ dependencies:
348
363
  - - "~>"
349
364
  - !ruby/object:Gem::Version
350
365
  version: '3.5'
366
+ - - "<"
367
+ - !ruby/object:Gem::Version
368
+ version: '3.8'
351
369
  - !ruby/object:Gem::Dependency
352
370
  name: rspec_junit_formatter
353
371
  requirement: !ruby/object:Gem::Requirement