chef 15.11.3 → 15.11.8

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
  SHA256:
3
- metadata.gz: 284b837896f77e4369e5cf591eb17b9a71761df8524a920f36afd7112093eab4
4
- data.tar.gz: 8d750cfd693024f1a1a0fd4b0cec42086be4562593dbfb426baece630fe6f2e2
3
+ metadata.gz: e2df99a745fd7cfaf51e23b8bae5790d83153e773f3dbb371595b237f123ec35
4
+ data.tar.gz: e25709142e35f3df576f7346f5355fc85b08a3c56bafe9ad73ea2f2ab6a394bf
5
5
  SHA512:
6
- metadata.gz: eb3a42ffe7ac30522a82e35cb852bdf2593ca4d174bc751db126cd40cd8a4eafab1e71c2525242b0889ada8539e135d087ad7d835f3f42cff1863e41c22ca77d
7
- data.tar.gz: e6c0733787eef6eff73bb4a0017f431c5cb7683ef9ff72ea5c673418b8ea4cc737f5559bf13f651f2737b11db4fef011a95220572b0ff9bd2e78ff3fb5d482e9
6
+ metadata.gz: 75d116789c0412f953543c5cb30ac3d454b14e073949c002a060650500406b92a72b726bb1fd689866fa978d6a2091d632cf330ddd9655f217cbe562518ec3f1
7
+ data.tar.gz: f3146ac9f1a70433f8a510aefd5af9ed48e80a9505716c4b9cd6cabe929d94d8d94a837c877f9b82dd5d909bc59ae1bad16431957fd89c2c7ab4b1b072a27856
@@ -1108,7 +1108,8 @@ class Chef
1108
1108
  # These keys are available in Chef::Config, and are prefixed with the protocol name.
1109
1109
  # For example, :user CLI option will map to :winrm_user and :ssh_user Chef::Config keys,
1110
1110
  # based on the connection protocol in use.
1111
- def knife_key_for_protocol(protocol, option)
1111
+ def knife_key_for_protocol(new_option, option = nil)
1112
+ option = new_option if option.nil? # hacky compat with both old Chef-15 style and new Chef-16 style API signature
1112
1113
  "#{connection_protocol}_#{option}".to_sym
1113
1114
  end
1114
1115
 
@@ -23,7 +23,7 @@ require_relative "version_string"
23
23
 
24
24
  class Chef
25
25
  CHEF_ROOT = File.expand_path("../..", __FILE__)
26
- VERSION = Chef::VersionString.new("15.11.3")
26
+ VERSION = Chef::VersionString.new("15.11.8")
27
27
  end
28
28
 
29
29
  #
@@ -25,9 +25,10 @@ module Shell
25
25
  end
26
26
 
27
27
  $LOAD_PATH.unshift File.expand_path("../..", __FILE__)
28
-
28
+ $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
29
29
  $LOAD_PATH.unshift File.expand_path("../../chef-config/lib", __FILE__)
30
30
  $LOAD_PATH.unshift File.expand_path("../../chef-utils/lib", __FILE__)
31
+ $LOAD_PATH.unshift File.dirname(__FILE__)
31
32
 
32
33
  require "rubygems"
33
34
  require "rspec/mocks"
@@ -103,6 +104,12 @@ resource_priority_map ||= nil
103
104
  provider_handler_map ||= nil
104
105
  resource_handler_map ||= nil
105
106
 
107
+ class UnexpectedSystemExit < RuntimeError
108
+ def self.from(system_exit)
109
+ new(system_exit.message).tap { |e| e.set_backtrace(system_exit.backtrace) }
110
+ end
111
+ end
112
+
106
113
  RSpec.configure do |config|
107
114
  config.include(Matchers)
108
115
  config.include(MockShellout::RSpec)
@@ -282,6 +289,15 @@ RSpec.configure do |config|
282
289
  config.before(:suite) do
283
290
  ARGV.clear
284
291
  end
292
+
293
+ # Protect Rspec from accidental exit(0) causing rspec to terminate without error
294
+ config.around(:example) do |ex|
295
+ begin
296
+ ex.run
297
+ rescue SystemExit => e
298
+ raise UnexpectedSystemExit.from(e)
299
+ end
300
+ end
285
301
  end
286
302
 
287
303
  require "webrick/utils"
@@ -27,7 +27,7 @@ Chef::Log.level(Chef::Config.log_level)
27
27
  Chef::Config.solo(false)
28
28
 
29
29
  def sha256_checksum(path)
30
- OpenSSL::Digest::SHA256.hexdigest(File.read(path))
30
+ OpenSSL::Digest.hexdigest("SHA256", File.read(path))
31
31
  end
32
32
 
33
33
  # extracted from Ruby < 2.5 to return a unique temp file name without creating it
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require File.expand_path("../../spec_helper", __FILE__)
18
+ require_relative "../spec_helper"
19
19
  require "chef/data_collector"
20
20
  require "socket"
21
21
 
@@ -93,7 +93,7 @@ describe Chef::FileAccessControl do
93
93
  end
94
94
 
95
95
  it "wraps uids to their negative complements to correctly handle negative uids" do
96
- # More: Mac OS X (at least) has negative UIDs for 'nobody' and some other
96
+ # More: macOS (at least) has negative UIDs for 'nobody' and some other
97
97
  # users. Ruby doesn't believe in negative UIDs so you get the diminished radix
98
98
  # complement (i.e., it wraps around the maximum size of C unsigned int) of these
99
99
  # uids. So we have to get ruby and negative uids to smoke the peace pipe
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require File.expand_path("../../spec_helper", __FILE__)
19
+ require_relative "../spec_helper"
20
20
  require "chef/json_compat"
21
21
 
22
22
  describe Chef::JSONCompat do
@@ -38,7 +38,7 @@ EOF
38
38
 
39
39
  # Output of the command:
40
40
  # => gpg --with-fingerprint --with-colons [FILE]
41
- GPG_FINGER = <<~EOF.freeze
41
+ APT_GPG_FINGER = <<~EOF.freeze
42
42
  pub:-:1024:17:327574EE02A818DD:2009-04-22:::-:Cloudera Apt Repository:
43
43
  fpr:::::::::F36A89E33CC1BD0F71079007327574EE02A818DD:
44
44
  sub:-:2048:16:84080586D1CA74A1:2009-04-22::::
@@ -63,7 +63,7 @@ describe Chef::Provider::AptRepository do
63
63
  end
64
64
 
65
65
  let(:gpg_finger) do
66
- double("shell_out", stdout: GPG_FINGER, exitstatus: 0, error?: false)
66
+ double("shell_out", stdout: APT_GPG_FINGER, exitstatus: 0, error?: false)
67
67
  end
68
68
 
69
69
  let(:gpg_shell_out_success) do
@@ -27,7 +27,7 @@ EOF
27
27
 
28
28
  # Output of the command:
29
29
  # => gpg --with-fingerprint [FILE]
30
- GPG_FINGER = <<~EOF.freeze
30
+ ZYPPER_GPG_FINGER = <<~EOF.freeze
31
31
  pub 2048R/3DBDC284 2011-08-19 [expires: 2024-06-14]
32
32
  Key fingerprint = 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62
33
33
  uid nginx signing key <signing-key@nginx.com>
@@ -49,7 +49,7 @@ describe Chef::Provider::ZypperRepository do
49
49
  end
50
50
 
51
51
  let(:gpg_finger) do
52
- double("shell_out", stdout: GPG_FINGER, exitstatus: 0, error?: false)
52
+ double("shell_out", stdout: ZYPPER_GPG_FINGER, exitstatus: 0, error?: false)
53
53
  end
54
54
 
55
55
  it "responds to load_current_resource" do
@@ -19,7 +19,7 @@
19
19
  # limitations under the License.
20
20
  #
21
21
 
22
- require File.expand_path("../../spec_helper", __FILE__)
22
+ require_relative "../spec_helper"
23
23
  require "chef/resource_reporter"
24
24
  require "socket"
25
25
 
@@ -15,7 +15,7 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
 
18
- require File.expand_path("../../spec_helper", __FILE__)
18
+ require_relative "../spec_helper"
19
19
  require "chef/client"
20
20
 
21
21
  describe Chef::RunLock do
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require File.expand_path("../../spec_helper", __FILE__)
18
+ require_relative "../spec_helper"
19
19
  require "chef/scan_access_control"
20
20
 
21
21
  describe Chef::ScanAccessControl do
@@ -41,39 +41,31 @@ begin
41
41
 
42
42
  task spec: :component_specs
43
43
 
44
- desc "Run standard specs (minus long running specs)"
44
+ desc "Run all specs in spec directory"
45
45
  RSpec::Core::RakeTask.new(:spec) do |t|
46
+ t.verbose = false
46
47
  t.rspec_opts = %w{--profile}
47
- # right now this just limits to functional + unit, but could also remove
48
- # individual tests marked long-running
49
48
  t.pattern = FileList["spec/**/*_spec.rb"]
50
49
  end
51
50
 
52
51
  namespace :spec do
53
- desc "Run all specs in spec directory with RCov"
54
- RSpec::Core::RakeTask.new(:rcov) do |t|
55
- t.rspec_opts = %w{--profile}
56
- t.pattern = FileList["spec/**/*_spec.rb"]
57
- t.rcov = true
58
- t.rcov_opts = lambda do
59
- IO.readlines("#{CHEF_ROOT}/spec/rcov.opts").map { |l| l.chomp.split " " }.flatten
60
- end
61
- end
62
-
63
52
  desc "Run all specs in spec directory"
64
53
  RSpec::Core::RakeTask.new(:all) do |t|
54
+ t.verbose = false
65
55
  t.rspec_opts = %w{--profile}
66
56
  t.pattern = FileList["spec/**/*_spec.rb"]
67
57
  end
68
58
 
69
59
  desc "Print Specdoc for all specs"
70
60
  RSpec::Core::RakeTask.new(:doc) do |t|
61
+ t.verbose = false
71
62
  t.rspec_opts = %w{--format specdoc --dry-run --profile}
72
63
  t.pattern = FileList["spec/**/*_spec.rb"]
73
64
  end
74
65
 
75
66
  desc "Run the specs under spec/unit with activesupport loaded"
76
67
  RSpec::Core::RakeTask.new(:activesupport) do |t|
68
+ t.verbose = false
77
69
  t.rspec_opts = %w{--require active_support/core_ext --profile}
78
70
  # Only node_spec and role_spec specifically have issues, target those tests
79
71
  t.pattern = FileList["spec/unit/node_spec.rb", "spec/unit/role_spec.rb"]
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: 15.11.3
4
+ version: 15.11.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-22 00:00:00.000000000 Z
11
+ date: 2020-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-config
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 15.11.3
19
+ version: 15.11.8
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: 15.11.3
26
+ version: 15.11.8
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: chef-utils
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 15.11.3
33
+ version: 15.11.8
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 15.11.3
40
+ version: 15.11.8
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: train-core
43
43
  requirement: !ruby/object:Gem::Requirement