chef 17.9.52 → 17.10.0

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: 944116661453cac4b29602c659f1f9ce7bb6e7c5b6742ab4d8982fdb7ccf9543
4
- data.tar.gz: bbc55e863772d4e5d72d5936b2a034c43746502dea51734b9e1402b0055070e5
3
+ metadata.gz: 6ac04518e7a36c9f65ca1a131832704645b078bf0290708683d6dd5cfeb8975c
4
+ data.tar.gz: 339602296915ea1c25bd3581db776b7478f109a1a6b0e6b1b887113357ebf0c9
5
5
  SHA512:
6
- metadata.gz: bdb9b7dc0f162c740995850f6a32a32c618448cc5d475dba7d30acec38eaa2e98a259b3051f82d7ed63ba5000a9ac259b6c0643d1a7cc05b69bdb7d212d266f5
7
- data.tar.gz: 17418b25e596b3bf1d9942357b99c23cf0e9ffdf3a74a57e1943d48c26f8efd410ca50fc1e64740c721e8a97761bcd3fe504a434ad80a2cb40f4adf3419b3b25
6
+ metadata.gz: 1abbcfb133838d1b902a033589f24529331dea60e4da3c6678c1e1e666c29601175671ca837e23ea7e0a02ed327a1b7a8be0ee9bf73a62cf9a994634bf909ff0
7
+ data.tar.gz: 4bae17edf6da41be96f21055a3d9d456b57c75e04f4faeb9155af8ee23d5d43a6f3c6952c06131473a3818e461c941ddeb482f92cf46c7e18553bbef1f4ebc9f
@@ -14,7 +14,8 @@ gemspec.add_dependency "win32-service", ">= 2.1.5", "< 3.0"
14
14
  gemspec.add_dependency "wmi-lite", "~> 1.0"
15
15
  gemspec.add_dependency "win32-taskscheduler", "~> 2.0"
16
16
  gemspec.add_dependency "iso8601", ">= 0.12.1", "< 0.14" # validate 0.14 when it comes out
17
- gemspec.add_dependency "win32-certstore", "~> 0.6.2" # 0.5+ required for specifying user vs. system store
17
+ gemspec.add_dependency "win32-certstore", "~> 0.6.2"
18
+ gemspec.add_dependency "chef-powershell", "~> 1.0.12" # 0.5+ required for specifying user vs. system store
18
19
  gemspec.extensions << "ext/win32-eventlog/Rakefile"
19
20
  gemspec.files += Dir.glob("{distro,ext}/**/*")
20
21
 
data/chef.gemspec CHANGED
@@ -42,7 +42,7 @@ Gem::Specification.new do |s|
42
42
  s.add_dependency "ffi-yajl", "~> 2.2"
43
43
  s.add_dependency "net-sftp", ">= 2.1.2", "< 4.0" # remote_file resource
44
44
  s.add_dependency "erubis", "~> 2.7" # template resource / cookbook syntax check
45
- s.add_dependency "diff-lcs", ">= 1.2.4", "< 1.4.0" # 1.4 breaks output. Used in lib/chef/util/diff
45
+ s.add_dependency "diff-lcs", ">= 1.2.4", "!= 1.4.0", "< 1.6.0" # 1.4 breaks output. Used in lib/chef/util/diff
46
46
  s.add_dependency "ffi-libarchive", "~> 1.0", ">= 1.0.3" # archive_file resource
47
47
  s.add_dependency "chef-zero", ">= 14.0.11"
48
48
  s.add_dependency "chef-vault" # chef-vault resources and helpers
@@ -196,7 +196,7 @@ class Chef
196
196
  end
197
197
 
198
198
  def reregister
199
- reregistered_self = http_api.put("clients/#{name}", { name: name, admin: admin, validator: validator, private_key: true })
199
+ reregistered_self = http_api.put("clients/#{name}", name: name, admin: admin, validator: validator, private_key: true )
200
200
  if reregistered_self.respond_to?(:[])
201
201
  private_key(reregistered_self["private_key"])
202
202
  else
@@ -248,8 +248,7 @@ class Chef
248
248
  end
249
249
 
250
250
  def api_service
251
- @api_service ||= Chef::ServerAPI.new(config[:chef_server_url],
252
- { version_class: Chef::CookbookManifestVersions })
251
+ @api_service ||= Chef::ServerAPI.new(config[:chef_server_url], version_class: Chef::CookbookManifestVersions )
253
252
  end
254
253
 
255
254
  def config
@@ -507,7 +507,7 @@ class Chef
507
507
  # @api private
508
508
  def api_service
509
509
  @api_service ||= Chef::ServerAPI.new(config[:chef_server_url],
510
- { version_class: Chef::CookbookManifestVersions })
510
+ version_class: Chef::CookbookManifestVersions)
511
511
  end
512
512
 
513
513
  # @api private
@@ -214,7 +214,7 @@ class Chef
214
214
  def install(gem_dependency, options = {})
215
215
  with_gem_sources(*options.delete(:sources)) do
216
216
  with_correct_verbosity do
217
- dependency_installer(options).install(gem_dependency)
217
+ dependency_installer(**options).install(gem_dependency)
218
218
  end
219
219
  end
220
220
  end
@@ -228,7 +228,7 @@ class Chef
228
228
  def uninstall(gem_name, gem_version = nil, opts = {})
229
229
  gem_version ? opts[:version] = gem_version : opts[:all] = true
230
230
  with_correct_verbosity do
231
- uninstaller(gem_name, opts).uninstall
231
+ uninstaller(gem_name, **opts).uninstall
232
232
  end
233
233
  end
234
234
 
@@ -240,12 +240,12 @@ class Chef
240
240
  yield
241
241
  end
242
242
 
243
- def dependency_installer(opts = {})
244
- Gem::DependencyInstaller.new(opts)
243
+ def dependency_installer(**opts)
244
+ Gem::DependencyInstaller.new(**opts)
245
245
  end
246
246
 
247
- def uninstaller(gem_name, opts = {})
248
- Gem::Uninstaller.new(gem_name, DEFAULT_UNINSTALLER_OPTS.merge(opts))
247
+ def uninstaller(gem_name, **opts)
248
+ Gem::Uninstaller.new(gem_name, **DEFAULT_UNINSTALLER_OPTS.merge(opts))
249
249
  end
250
250
 
251
251
  private
@@ -178,7 +178,20 @@ class Chef
178
178
  #
179
179
  # @api private
180
180
  def combine_args(provides, version, arch)
181
- provides = provides.dup
181
+ provides = provides.to_s.strip
182
+ version = if !version.nil? && !version.empty?
183
+ version.to_s.strip
184
+ end
185
+ arch = if !arch.nil? && !arch.empty?
186
+ arch.to_s.strip
187
+ end
188
+ if version =~ /^[><=]/
189
+ if arch
190
+ return { "provides" => "#{provides}.#{arch} #{version}" }
191
+ else
192
+ return { "provides" => "#{provides} #{version}" }
193
+ end
194
+ end
182
195
  maybe_arch = provides.rpartition(".").last
183
196
  if is_arch?(maybe_arch)
184
197
  arch = maybe_arch
@@ -183,7 +183,7 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service
183
183
  end
184
184
 
185
185
  converge_by("create service #{new_resource.service_name}") do
186
- Win32::Service.new(windows_service_config)
186
+ Win32::Service.new(**windows_service_config)
187
187
  end
188
188
 
189
189
  converge_delayed_start
@@ -209,7 +209,7 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service
209
209
  converge_if_changed :service_type, :startup_type, :error_control,
210
210
  :binary_path_name, :load_order_group, :dependencies,
211
211
  :run_as_user, :display_name, :description do
212
- Win32::Service.configure(windows_service_config(:configure))
212
+ Win32::Service.configure(**windows_service_config(:configure))
213
213
  end
214
214
 
215
215
  converge_delayed_start
@@ -268,7 +268,7 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service
268
268
  password: new_resource.run_as_password,
269
269
  }.reject { |k, v| v.nil? || v.length == 0 }
270
270
 
271
- Win32::Service.configure(new_config)
271
+ Win32::Service.configure(**new_config)
272
272
  logger.info "#{new_resource} configured."
273
273
 
274
274
  grant_service_logon(new_resource.run_as_user) if new_resource.run_as_user != "localsystem"
@@ -395,7 +395,7 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service
395
395
  config[:service_name] = new_resource.service_name
396
396
  config[:delayed_start] = new_resource.delayed_start ? 1 : 0
397
397
 
398
- Win32::Service.configure(config)
398
+ Win32::Service.configure(**config)
399
399
  end
400
400
  end
401
401
 
@@ -78,11 +78,11 @@ class Chef
78
78
  end
79
79
 
80
80
  def create_user
81
- @net_user.add(set_options)
81
+ @net_user.add(**set_options)
82
82
  end
83
83
 
84
84
  def manage_user
85
- @net_user.update(set_options)
85
+ @net_user.update(**set_options)
86
86
  end
87
87
 
88
88
  def remove_user
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.52")
26
+ VERSION = Chef::VersionString.new("17.10.0")
27
27
  end
28
28
 
29
29
  #
@@ -709,6 +709,21 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
709
709
  action :install
710
710
  end.should_not_be_updated
711
711
  end
712
+
713
+ it "works with constraints in the version property" do
714
+ flush_cache
715
+ dnf_package "chef_rpm" do
716
+ version ">= 1.10"
717
+ options default_options
718
+ action :install
719
+ end.should_be_updated
720
+ expect_matching_installed_version("^chef_rpm-1.10-1.#{pkg_arch}$")
721
+ dnf_package "chef_rpm" do
722
+ version ">= 1.10"
723
+ options default_options
724
+ action :install
725
+ end.should_not_be_updated
726
+ end
712
727
  end
713
728
 
714
729
  context "with source arguments" do
@@ -754,6 +754,21 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
754
754
  action :install
755
755
  end.should_not_be_updated
756
756
  end
757
+
758
+ it "works with constraints in the version property" do
759
+ flush_cache
760
+ yum_package "chef_rpm" do
761
+ version ">= 1.10"
762
+ options default_options
763
+ action :install
764
+ end.should_be_updated
765
+ expect_matching_installed_version("^chef_rpm-1.10-1.#{pkg_arch}$")
766
+ yum_package "chef_rpm" do
767
+ version ">= 1.10"
768
+ options default_options
769
+ action :install
770
+ end.should_not_be_updated
771
+ end
757
772
  end
758
773
 
759
774
  context "with source arguments" 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: 17.9.52
4
+ version: 17.10.0
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-02-18 00:00:00.000000000 Z
11
+ date: 2022-03-17 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.52
19
+ version: 17.10.0
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.52
26
+ version: 17.10.0
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.52
33
+ version: 17.10.0
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.52
40
+ version: 17.10.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: train-core
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -289,9 +289,12 @@ dependencies:
289
289
  - - ">="
290
290
  - !ruby/object:Gem::Version
291
291
  version: 1.2.4
292
- - - "<"
292
+ - - "!="
293
293
  - !ruby/object:Gem::Version
294
294
  version: 1.4.0
295
+ - - "<"
296
+ - !ruby/object:Gem::Version
297
+ version: 1.6.0
295
298
  type: :runtime
296
299
  prerelease: false
297
300
  version_requirements: !ruby/object:Gem::Requirement
@@ -299,9 +302,12 @@ dependencies:
299
302
  - - ">="
300
303
  - !ruby/object:Gem::Version
301
304
  version: 1.2.4
302
- - - "<"
305
+ - - "!="
303
306
  - !ruby/object:Gem::Version
304
307
  version: 1.4.0
308
+ - - "<"
309
+ - !ruby/object:Gem::Version
310
+ version: 1.6.0
305
311
  - !ruby/object:Gem::Dependency
306
312
  name: ffi-libarchive
307
313
  requirement: !ruby/object:Gem::Requirement