cheffish 16.0.26 → 17.0.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: 91e2132a23578c15fe42a8603cf3cd4d72eee69a671f853c273a5a61788f9a31
4
- data.tar.gz: 75a4e43250b1b53eb3fd10aee2af0dd5e62e3ee5a6bcede10792691d77080d7c
3
+ metadata.gz: 6a022a0802ceebdb2656147e6ada5348b95a0d6df170317ce7407d049502c741
4
+ data.tar.gz: ea8e169d0521142100ab4224be43a870c375f3c32a25f509ff0de15b7343384c
5
5
  SHA512:
6
- metadata.gz: 93706f7357daca264cbdd1ca1a6b3d2912597968e68f58ae376fc71284a3d7f4c92bbf91d31a9fdd3450d317e1961ea91372c3f348a77465a27d8f73a40d45ab
7
- data.tar.gz: 3e47fb9564110ced0731b2c19f00af626482fc9fc4daa6be1e7c056a583c22f43a6aae8a64489899ffd7ceef10c17f7d12b942240cf65a8331fd34ee48ec020f
6
+ metadata.gz: f2ade13896c429b961aa71d2ff1c721102e7d896d7ba7d157b13a312dc9c3268de544e4d2883cccd48f5d68e09c915ce34217eff02b9fde2be73fb2bc597aef2
7
+ data.tar.gz: b6b89cfdc3d836c83330619ec878e503de1226591779728229fbff51b6cff6bb9cd4624796eba695ff51e8e326e97c90ffc913e1b0d39ed7b01f16535ef5c217
data/Gemfile CHANGED
@@ -3,19 +3,23 @@ source "https://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  group :development do
6
- gem "chefstyle", "1.7.4"
6
+ gem "chefstyle", "1.7.5"
7
7
  gem "rake"
8
8
  gem "rspec", "~> 3.0"
9
9
  end
10
10
 
11
+
11
12
  # Allow Travis to run tests with different dependency versions
12
13
  if ENV["GEMFILE_MOD"]
13
14
  puts ENV["GEMFILE_MOD"]
14
15
  instance_eval(ENV["GEMFILE_MOD"])
15
16
  else
16
17
  group :development do
17
- gem "chef", "~> 16"
18
- gem "ohai", "~> 16"
18
+ # temporarily we only support building against master
19
+ gem "chef", github: "chef/chef", branch: "master"
20
+ gem "ohai", github: "chef/ohai", branch: "master"
21
+ # gem "chef", "~> 16"
22
+ # gem "ohai", "~> 16"
19
23
  end
20
24
  end
21
25
 
data/Rakefile CHANGED
@@ -39,4 +39,4 @@ task :console do
39
39
  IRB.start
40
40
  end
41
41
 
42
- task default: %i{style spec}
42
+ task default: %i{spec style}
data/cheffish.gemspec CHANGED
@@ -12,9 +12,10 @@ Gem::Specification.new do |s|
12
12
  s.email = "oss@chef.io"
13
13
  s.homepage = "https://github.com/chef/cheffish"
14
14
 
15
- s.required_ruby_version = ">= 2.6.0"
15
+ s.required_ruby_version = ">= 2.7.0"
16
16
 
17
17
  s.add_dependency "chef-zero", ">= 14.0"
18
+ s.add_dependency "chef-utils", ">= 17.0"
18
19
  s.add_dependency "net-ssh"
19
20
 
20
21
  s.bindir = "bin"
@@ -1,9 +1,11 @@
1
1
  require_relative "../../cheffish"
2
2
  require_relative "../../cheffish/base_resource"
3
3
  require "chef/chef_fs/data_handler/acl_data_handler"
4
- require "chef/chef_fs/parallelizer"
4
+ require "chef-utils/parallel_map" unless defined?(ChefUtils::ParallelMap)
5
5
  require "uri" unless defined?(URI)
6
6
 
7
+ using ChefUtils::ParallelMap
8
+
7
9
  class Chef
8
10
  class Resource
9
11
  class ChefAcl < Cheffish::BaseResource
@@ -126,13 +128,13 @@ class Chef
126
128
  # the ACL has changed.
127
129
  if new_resource.recursive == true || (new_resource.recursive == :on_change && (!acl || changed))
128
130
  children, _error = list(path, "*")
129
- Chef::ChefFS::Parallelizer.parallel_do(children) do |child|
131
+ children.parallel_each do |child|
130
132
  next if child.split("/")[-1] == "containers"
131
133
 
132
134
  create_acl(child)
133
135
  end
134
136
  # containers mess up our descent, so we do them last
135
- Chef::ChefFS::Parallelizer.parallel_do(children) do |child|
137
+ children.parallel_each do |child|
136
138
  next if child.split("/")[-1] != "containers"
137
139
 
138
140
  create_acl(child)
@@ -301,7 +303,7 @@ class Chef
301
303
  #
302
304
  # Result: /*/foo = [ '/organizations/foo', '/users/foo' ]
303
305
  #
304
- matches = Chef::ChefFS::Parallelizer.parallelize(matches) do |pth|
306
+ matches = matches.parallel_map do |pth|
305
307
  found, error = list(pth, part)
306
308
  if error
307
309
  if parts[0..index - 1].all? { |p| p != "*" }
@@ -312,7 +314,7 @@ class Chef
312
314
  else
313
315
  found
314
316
  end
315
- end.flatten(1).to_a
317
+ end.flatten.to_a
316
318
  end
317
319
 
318
320
  matches
@@ -2,9 +2,11 @@ require_relative "../../cheffish"
2
2
  require_relative "../../cheffish/base_resource"
3
3
  require "chef/chef_fs/file_pattern"
4
4
  require "chef/chef_fs/file_system"
5
- require "chef/chef_fs/parallelizer"
6
5
  require "chef/chef_fs/file_system/chef_server/chef_server_root_dir"
7
6
  require "chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir"
7
+ require "chef-utils/parallel_map" unless defined?(ChefUtils::ParallelMap)
8
+
9
+ using ChefUtils::ParallelMap
8
10
 
9
11
  class Chef
10
12
  class Resource
@@ -97,7 +99,7 @@ class Chef
97
99
  end
98
100
 
99
101
  # Honor concurrency
100
- Chef::ChefFS::Parallelizer.threads = new_resource.concurrency - 1
102
+ ChefUtils::DefaultThreadPool.instance.threads = new_resource.concurrency - 1
101
103
 
102
104
  # We don't let the user pass absolute paths; we want to reserve those for
103
105
  # multi-org support (/organizations/foo).
@@ -1,3 +1,3 @@
1
1
  module Cheffish
2
- VERSION = "16.0.26".freeze
2
+ VERSION = "17.0.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cheffish
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.0.26
4
+ version: 17.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-02 00:00:00.000000000 Z
11
+ date: 2021-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-zero
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '14.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: chef-utils
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '17.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '17.0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: net-ssh
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -120,7 +134,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
120
134
  requirements:
121
135
  - - ">="
122
136
  - !ruby/object:Gem::Version
123
- version: 2.6.0
137
+ version: 2.7.0
124
138
  required_rubygems_version: !ruby/object:Gem::Requirement
125
139
  requirements:
126
140
  - - ">="