chef 17.9.26 → 17.9.42

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: 36dbce2fafed93ea8c76e98161ac43fd4e11dfece0cfaffb37de8ccc0e6d3635
4
- data.tar.gz: 0bf1c93e247430baf36b78eb3b942ba1037f9c23429efc5f05fa9e5ff3ed4bfa
3
+ metadata.gz: 81905931cf4ca87528c65bb2be19f6656fcbf6754612da872f3c74e9c0e8753f
4
+ data.tar.gz: 75e630d0ac718daabb1854788c2428b765ea05229a25a21974812b5e4063a30a
5
5
  SHA512:
6
- metadata.gz: d8054644c9e4cf9ead5fc960de3f4561d78afd86cb5b43cfb9893cfc772726a4a6c262dfd9bcff44bfea6a047515f93b78dec98d52afa7d0d764beee2fa68380
7
- data.tar.gz: 7e57743c2142e7d979a679593d035916c46fb85290c49f059f49830d075dbd343c122dd0b8546912482b6f4ef7108cd780a36836c1b6005cca9f269351318917
6
+ metadata.gz: db10283eb9a37f5b8dfd7223583eba74dc536277de8c5d424872c66b36102b505b07de211e9cd6022aa03d371339ebbc97846f5d3e534bbdf10896bde43fcb7a
7
+ data.tar.gz: 5bcaf6a2182e345138d53e67967a5b956c4bcdfd700f8c8b35994a15d71a0e5ed87a8327ccc6a7cb690b52c8c4043db1df65f16509b6268d7bc2a8169ef76875
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ source "https://rubygems.org"
2
2
 
3
3
  gem "chef", path: "."
4
4
 
5
- gem "ohai", git: "https://github.com/chef/ohai.git", branch: "main"
5
+ gem "ohai", git: "https://github.com/chef/ohai.git", branch: "17-stable"
6
6
 
7
7
  gem "chef-utils", path: File.expand_path("chef-utils", __dir__) if File.exist?(File.expand_path("chef-utils", __dir__))
8
8
  gem "chef-config", path: File.expand_path("chef-config", __dir__) if File.exist?(File.expand_path("chef-config", __dir__))
@@ -15,7 +15,7 @@ else
15
15
  gem "chef-bin" # rubocop:disable Bundler/DuplicatedGem
16
16
  end
17
17
 
18
- gem "cheffish", ">= 17"
18
+ gem "cheffish", "~> 17.0"
19
19
 
20
20
  group(:omnibus_package) do
21
21
  gem "appbundler"
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Chef Infra
2
2
  [![Code Climate](https://codeclimate.com/github/chef/chef.svg)](https://codeclimate.com/github/chef/chef)
3
- [![Build Status](https://badge.buildkite.com/c82093430ceec7d27af05febb9dcafe3aa331fff9d74c0ab9d.svg?branch=master)](https://buildkite.com/chef-oss/chef-chef-master-verify)
3
+ [![Build Status](https://badge.buildkite.com/c82093430ceec7d27af05febb9dcafe3aa331fff9d74c0ab9d.svg?branch=chef-17)](https://buildkite.com/chef-oss/chef-chef-chef-17-verify)
4
4
  [![Gem Version](https://badge.fury.io/rb/chef.svg)](https://badge.fury.io/rb/chef)
5
5
  [![](https://img.shields.io/badge/Release%20Policy-Cadence%20Release-brightgreen.svg)](https://github.com/chef/chef/blob/master/docs/dev/design_documents/client_release_cadence.md)
6
6
 
@@ -38,7 +38,7 @@ class Chef
38
38
 
39
39
  def read
40
40
  tmpfile = rest.streaming_request(file[:url])
41
- File.open(tmpfile, "rb", &:read)
41
+ File.binread(tmpfile)
42
42
  rescue Timeout::Error => e
43
43
  raise Chef::ChefFS::FileSystem::OperationFailedError.new(:read, self, e, "Timeout reading #{file[:url]}: #{e}")
44
44
  rescue Net::HTTPClientException => e
@@ -123,7 +123,7 @@ class Chef
123
123
  if is_ruby_file?
124
124
  data_handler.from_ruby(file_path).to_json
125
125
  else
126
- File.open(file_path, "rb", &:read)
126
+ File.binread(file_path)
127
127
  end
128
128
  rescue Errno::ENOENT
129
129
  raise Chef::ChefFS::FileSystem::NotFoundError.new(self, $!)
@@ -126,7 +126,7 @@ class Chef
126
126
  end
127
127
 
128
128
  def read
129
- File.open(file_path, "rb", &:read)
129
+ File.binread(file_path)
130
130
  rescue Errno::ENOENT
131
131
  raise Chef::ChefFS::FileSystem::NotFoundError.new(self, $!)
132
132
  end
@@ -57,7 +57,7 @@ class Chef
57
57
  # @return [Array<Input>] inspec inputs which are enabled in a form suitable to pass to inspec
58
58
  #
59
59
  def inspec_data
60
- select(&:enabled?).each_with_object({}) { |input, hash| hash.merge(input.inspec_data) }
60
+ select(&:enabled?).each_with_object({}) { |input, hash| hash.merge!(input.inspec_data) }
61
61
  end
62
62
 
63
63
  # DSL method to enable input files. This matches on the filename of the input file.
@@ -57,7 +57,7 @@ class Chef
57
57
  # @return [Array<Waiver>] inspec waivers which are enabled in a form suitable to pass to inspec
58
58
  #
59
59
  def inspec_data
60
- select(&:enabled?).each_with_object({}) { |waiver, hash| hash.merge(waiver.inspec_data) }
60
+ select(&:enabled?).each_with_object({}) { |waiver, hash| hash.merge!(waiver.inspec_data) }
61
61
  end
62
62
 
63
63
  # DSL method to enable waiver files. This matches on the filename of the waiver file.
@@ -119,7 +119,7 @@ class Chef
119
119
  # but we need the base64 encoding for the content-md5
120
120
  # header
121
121
  checksum64 = Base64.encode64([checksum].pack("H*")).strip
122
- file_contents = File.open(file, "rb", &:read)
122
+ file_contents = File.binread(file)
123
123
 
124
124
  # Custom headers. 'content-type' disables JSON serialization of the request body.
125
125
  headers = { "content-type" => "application/x-binary", "content-md5" => checksum64, "accept" => "application/json" }
@@ -54,7 +54,7 @@ class Chef
54
54
  resource_class.run_context = run_context
55
55
  resource_class.class_from_file(filename)
56
56
 
57
- if !resource_class.unified_mode && !deprecated_class(resource_class)
57
+ if !resource_class.unified_mode && !deprecated_class(resource_class) && cookbook_name.to_s != "chef_client_updater"
58
58
  Chef.deprecated :unified_mode, "The #{resource_class.resource_name} resource in the #{cookbook_name} cookbook should declare `unified_mode true`", filename
59
59
  end
60
60
 
@@ -175,7 +175,7 @@ class Chef::Util::DSC
175
175
  end
176
176
 
177
177
  def get_configuration_document(document_path)
178
- ::File.open(document_path, "rb", &:read)
178
+ ::File.binread(document_path)
179
179
  end
180
180
  end
181
181
  end
data/lib/chef/version.rb CHANGED
@@ -23,7 +23,7 @@ require_relative "version_string"
23
23
 
24
24
  class Chef
25
25
  CHEF_ROOT = File.expand_path("..", __dir__)
26
- VERSION = Chef::VersionString.new("17.9.26")
26
+ VERSION = Chef::VersionString.new("17.9.42")
27
27
  end
28
28
 
29
29
  #
@@ -25,7 +25,7 @@ describe Chef::Resource::CookbookFile do
25
25
  let(:source) { "java.response" }
26
26
  let(:cookbook_name) { "java" }
27
27
  let(:expected_content) do
28
- content = File.open(File.join(CHEF_SPEC_DATA, "cookbooks", "java", "files", "default", "java.response"), "rb", &:read)
28
+ content = File.binread(File.join(CHEF_SPEC_DATA, "cookbooks", "java", "files", "default", "java.response"))
29
29
  content.force_encoding(Encoding::BINARY) if content.respond_to?(:force_encoding)
30
30
  content
31
31
  end
@@ -345,7 +345,7 @@ describe Chef::Resource::DscScript, :windows_powershell_dsc_only, :ruby64_only d
345
345
  let(:config_param_section) { config_params }
346
346
  let(:config_flags) { { "#{dsc_user_prefix_param_name}": (dsc_user_prefix).to_s, "#{dsc_user_suffix_param_name}": (dsc_user_suffix).to_s } }
347
347
  it "does not directly contain the user name" do
348
- configuration_script_content = ::File.open(dsc_test_resource.command, &:read)
348
+ configuration_script_content = ::File.read(dsc_test_resource.command)
349
349
  expect(configuration_script_content.include?(dsc_user)).to be(false)
350
350
  end
351
351
  it_behaves_like "a dsc_script with configuration data"
@@ -355,7 +355,7 @@ describe Chef::Resource::DscScript, :windows_powershell_dsc_only, :ruby64_only d
355
355
  let(:dsc_user_code) { dsc_user_env_code }
356
356
 
357
357
  it "does not directly contain the user name" do
358
- configuration_script_content = ::File.open(dsc_test_resource.command, &:read)
358
+ configuration_script_content = ::File.read(dsc_test_resource.command)
359
359
  expect(configuration_script_content.include?(dsc_user)).to be(false)
360
360
  end
361
361
  it_behaves_like "a dsc_script with configuration data"
@@ -21,7 +21,7 @@ require "spec_helper"
21
21
  describe Chef::Resource::Template do
22
22
 
23
23
  def binread(file)
24
- File.open(file, "rb", &:read)
24
+ File.binread(file)
25
25
  end
26
26
 
27
27
  include_context Chef::Resource::File
@@ -22,7 +22,7 @@ describe "chef-client" do
22
22
  # just a normal file
23
23
  # (expected_content should be uncompressed)
24
24
  @api.get("/recipes.tgz", 200) do
25
- File.open(recipes_filename, "rb", &:read)
25
+ File.binread(recipes_filename)
26
26
  end
27
27
  end
28
28
 
@@ -391,7 +391,7 @@ shared_examples_for "a configured file resource" do
391
391
  end
392
392
 
393
393
  def binread(file)
394
- content = File.open(file, "rb", &:read)
394
+ content = File.binread(file)
395
395
  content.force_encoding(Encoding::BINARY) if "".respond_to?(:force_encoding)
396
396
  content
397
397
  end
@@ -30,7 +30,7 @@ module ChefHTTPShared
30
30
  end
31
31
 
32
32
  def binread(file)
33
- content = File.open(file, "rb", &:read)
33
+ content = File.binread(file)
34
34
  content.force_encoding(Encoding::BINARY) if "".respond_to?(:force_encoding)
35
35
  content
36
36
  end
@@ -51,19 +51,19 @@ module ChefHTTPShared
51
51
  # just a normal file
52
52
  # (expected_content should be uncompressed)
53
53
  @api.get("/nyan_cat.png", 200) do
54
- File.open(nyan_uncompressed_filename, "rb", &:read)
54
+ File.binread(nyan_uncompressed_filename)
55
55
  end
56
56
 
57
57
  # this ends in .gz, we do not uncompress it and drop it on the filesystem as a .gz file (the internet often lies)
58
58
  # (expected_content should be compressed)
59
59
  @api.get("/nyan_cat.png.gz", 200, nil, { "Content-Type" => "application/gzip", "Content-Encoding" => "gzip" } ) do
60
- File.open(nyan_compressed_filename, "rb", &:read)
60
+ File.binread(nyan_compressed_filename)
61
61
  end
62
62
 
63
63
  # this is an uncompressed file that was compressed by some mod_gzip-ish webserver thingy, so we will expand it
64
64
  # (expected_content should be uncompressed)
65
65
  @api.get("/nyan_cat_compressed.png", 200, nil, { "Content-Type" => "application/gzip", "Content-Encoding" => "gzip" } ) do
66
- File.open(nyan_compressed_filename, "rb", &:read)
66
+ File.binread(nyan_compressed_filename)
67
67
  end
68
68
 
69
69
  #
@@ -75,7 +75,7 @@ module ChefHTTPShared
75
75
  {
76
76
  "Content-Length" => nyan_uncompressed_size.to_s,
77
77
  }) do
78
- File.open(nyan_uncompressed_filename, "rb", &:read)
78
+ File.binread(nyan_uncompressed_filename)
79
79
  end
80
80
 
81
81
  # (expected_content should be uncompressed)
@@ -85,7 +85,7 @@ module ChefHTTPShared
85
85
  "Content-Type" => "application/gzip",
86
86
  "Content-Encoding" => "gzip",
87
87
  }) do
88
- File.open(nyan_compressed_filename, "rb", &:read)
88
+ File.binread(nyan_compressed_filename)
89
89
  end
90
90
 
91
91
  #
@@ -97,7 +97,7 @@ module ChefHTTPShared
97
97
  {
98
98
  "Content-Length" => (nyan_uncompressed_size + 1).to_s,
99
99
  }) do
100
- File.open(nyan_uncompressed_filename, "rb", &:read)
100
+ File.binread(nyan_uncompressed_filename)
101
101
  end
102
102
 
103
103
  # (expected_content should be uncompressed)
@@ -107,7 +107,7 @@ module ChefHTTPShared
107
107
  "Content-Type" => "application/gzip",
108
108
  "Content-Encoding" => "gzip",
109
109
  }) do
110
- File.open(nyan_compressed_filename, "rb", &:read)
110
+ File.binread(nyan_compressed_filename)
111
111
  end
112
112
 
113
113
  #
@@ -120,7 +120,7 @@ module ChefHTTPShared
120
120
  "Content-Length" => (nyan_uncompressed_size + 1).to_s,
121
121
  "Transfer-Encoding" => "anything",
122
122
  }) do
123
- File.open(nyan_uncompressed_filename, "rb", &:read)
123
+ File.binread(nyan_uncompressed_filename)
124
124
  end
125
125
 
126
126
  #
@@ -74,7 +74,7 @@ describe Chef::Provider::User::Solaris do
74
74
  allow(Tempfile).to receive(:new).with("shadow", "/etc").and_return(temp_file)
75
75
  new_resource.password "verysecurepassword"
76
76
  provider.manage_user
77
- expect(::File.open(password_file.path, "r").read).to match(/adam:verysecurepassword:/)
77
+ expect(::File.read(password_file.path)).to match(/adam:verysecurepassword:/)
78
78
  password_file.unlink
79
79
  end
80
80
  end
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: 17.9.26
4
+ version: 17.9.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-04 00:00:00.000000000 Z
11
+ date: 2022-01-28 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: 17.9.26
19
+ version: 17.9.42
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: 17.9.26
26
+ version: 17.9.42
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: 17.9.26
33
+ version: 17.9.42
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: 17.9.26
40
+ version: 17.9.42
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: train-core
43
43
  requirement: !ruby/object:Gem::Requirement