chef 16.5.64-universal-mingw32 → 16.5.77-universal-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/chef.gemspec +1 -1
  3. data/lib/chef/application.rb +2 -2
  4. data/lib/chef/application/client.rb +1 -1
  5. data/lib/chef/application/solo.rb +1 -1
  6. data/lib/chef/chef_fs/chef_fs_data_store.rb +1 -1
  7. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb +1 -1
  8. data/lib/chef/cookbook/gem_installer.rb +1 -1
  9. data/lib/chef/event_loggers/windows_eventlog.rb +1 -1
  10. data/lib/chef/file_content_management/tempfile.rb +1 -1
  11. data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +1 -1
  12. data/lib/chef/formatters/indentable_output_stream.rb +2 -2
  13. data/lib/chef/knife/core/ui.rb +1 -1
  14. data/lib/chef/knife/node_policy_set.rb +2 -2
  15. data/lib/chef/knife/node_run_list_add.rb +1 -1
  16. data/lib/chef/knife/node_run_list_remove.rb +1 -1
  17. data/lib/chef/knife/node_run_list_set.rb +1 -1
  18. data/lib/chef/knife/role_env_run_list_add.rb +1 -1
  19. data/lib/chef/knife/role_env_run_list_set.rb +1 -1
  20. data/lib/chef/knife/role_run_list_add.rb +1 -1
  21. data/lib/chef/knife/role_run_list_set.rb +1 -1
  22. data/lib/chef/knife/search.rb +0 -1
  23. data/lib/chef/knife/ssh.rb +2 -2
  24. data/lib/chef/knife/tag_create.rb +1 -1
  25. data/lib/chef/knife/tag_delete.rb +1 -1
  26. data/lib/chef/local_mode.rb +1 -1
  27. data/lib/chef/mixin/template.rb +1 -1
  28. data/lib/chef/mixin/uris.rb +3 -1
  29. data/lib/chef/node_map.rb +2 -2
  30. data/lib/chef/policy_builder/dynamic.rb +2 -0
  31. data/lib/chef/provider.rb +1 -1
  32. data/lib/chef/provider/file.rb +1 -1
  33. data/lib/chef/provider/link.rb +0 -9
  34. data/lib/chef/provider/package/dpkg.rb +3 -12
  35. data/lib/chef/provider/package/homebrew.rb +1 -1
  36. data/lib/chef/provider/service/redhat.rb +1 -1
  37. data/lib/chef/provider/user/dscl.rb +2 -2
  38. data/lib/chef/provider/user/mac.rb +2 -2
  39. data/lib/chef/resource.rb +1 -1
  40. data/lib/chef/resource/apt_repository.rb +4 -2
  41. data/lib/chef/resource/chef_handler.rb +1 -0
  42. data/lib/chef/resource/cron/_cron_shared.rb +1 -0
  43. data/lib/chef/resource/file.rb +1 -1
  44. data/lib/chef/resource_reporter.rb +0 -2
  45. data/lib/chef/run_lock.rb +1 -1
  46. data/lib/chef/search/query.rb +3 -1
  47. data/lib/chef/util/backup.rb +1 -1
  48. data/lib/chef/version.rb +1 -1
  49. data/lib/chef/win32/file.rb +1 -1
  50. data/lib/chef/win32/unicode.rb +1 -1
  51. data/spec/spec_helper.rb +1 -3
  52. data/spec/unit/chef_fs/config_spec.rb +1 -1
  53. data/spec/unit/chef_fs/data_handler/data_bag_item_data_handler.rb +1 -1
  54. data/spec/unit/data_collector_spec.rb +0 -4
  55. metadata +8 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 322c3e0b32f3dd07e0c67a8b199a4ec323c5244cfab77cb961196bb16e6c1f08
4
- data.tar.gz: e1e3f70b4fbd0e7ba1fef4f870efaea2efde808ff6abe339ac93b91a2d86543a
3
+ metadata.gz: be66626e9a30881035691daab78994376a8b61f654e3eb3ca07157a35ec4aec4
4
+ data.tar.gz: bc3bf6bb5d75a908c6c8a805c2da1a732c42393a4d35570c6bfdca69845e566e
5
5
  SHA512:
6
- metadata.gz: 433d495043cfd6769751182a3c53aa9b11160855eff8d1bb67cfe32d2492c8bdd0534002fea1d2ae59a73e49a2b5ba22722639156f8fef7e8dc89bd4de7dcadc
7
- data.tar.gz: 96a87052405b0763955d05111213887902e9f899d11b0fab313c552b4ddccb19a3db88615ea9ab2b3596ba88cb68aeac4fe0305f8e9d3c1fb36a0f42d85d5cb5
6
+ metadata.gz: daf306b22d36bb452ae8ad642b3203cea5f1b60b5327a3c5b723e93c36256a18db1c02e8a9b29c119d64d00bbe5b04e28e8880f5af568f3a6cf5d0eda2469610
7
+ data.tar.gz: bb1093f29e376799b9f16b79e60b4ae03005ace97a9559d7820cdb40a97f21deffd2f1469b77721c3873a72df6561adcbedc79ce52f5b8c8500d30e05eca00a5
@@ -38,7 +38,7 @@ Gem::Specification.new do |s|
38
38
  s.add_dependency "highline", ">= 1.6.9", "< 3"
39
39
  s.add_dependency "tty-prompt", "~> 0.21" # knife ui.ask prompt
40
40
  s.add_dependency "tty-screen", "~> 0.6" # knife list
41
- s.add_dependency "tty-table", "~> 0.11.0" # knife render table output
41
+ s.add_dependency "tty-table", "~> 0.11" # knife render table output.
42
42
  s.add_dependency "pastel" # knife ui.color
43
43
  s.add_dependency "erubis", "~> 2.7"
44
44
  s.add_dependency "diff-lcs", ">= 1.2.4", "< 1.4.0" # 1.4 breaks output
@@ -27,7 +27,7 @@ require "mixlib/cli" unless defined?(Mixlib::CLI)
27
27
  require "tmpdir" unless defined?(Dir.mktmpdir)
28
28
  require "rbconfig" unless defined?(RbConfig)
29
29
  require_relative "application/exit_code"
30
- require "chef-utils" unless defined?(ChefUtils)
30
+ require "chef-utils" unless defined?(ChefUtils::CANARY)
31
31
  module LicenseAcceptance
32
32
  autoload :Acceptor, "license_acceptance/acceptor"
33
33
  end
@@ -172,7 +172,7 @@ class Chef
172
172
  def configure_logging
173
173
  configure_log_location
174
174
  logger.init(MonoLogger.new(chef_config[:log_location][0]))
175
- chef_config[:log_location][1..-1].each do |log_location|
175
+ chef_config[:log_location][1..].each do |log_location|
176
176
  logger.loggers << MonoLogger.new(log_location)
177
177
  end
178
178
  logger.level = resolve_log_level
@@ -21,7 +21,7 @@ require_relative "base"
21
21
  require_relative "../handler/error_report"
22
22
  require_relative "../workstation_config_loader"
23
23
  autoload :URI, "uri"
24
- require "chef-utils" unless defined?(ChefUtils)
24
+ require "chef-utils" unless defined?(ChefUtils::CANARY)
25
25
  module Mixlib
26
26
  module Authentication
27
27
  autoload :Log, "mixlib/authentication"
@@ -21,7 +21,7 @@ require_relative "../../chef"
21
21
  require_relative "client"
22
22
  require "fileutils" unless defined?(FileUtils)
23
23
  require "pathname" unless defined?(Pathname)
24
- require "chef-utils" unless defined?(ChefUtils)
24
+ require "chef-utils" unless defined?(ChefUtils::CANARY)
25
25
 
26
26
  # DO NOT MAKE EDITS, see Chef::Application::Base
27
27
  #
@@ -265,7 +265,7 @@ class Chef
265
265
  @memory_store.get(path)
266
266
 
267
267
  elsif path[0] == "file_store" && path[1] == "repo"
268
- entry = Chef::ChefFS::FileSystem.resolve_path(chef_fs, path[2..-1].join("/"))
268
+ entry = Chef::ChefFS::FileSystem.resolve_path(chef_fs, path[2..].join("/"))
269
269
  begin
270
270
  entry.read
271
271
  rescue Chef::ChefFS::FileSystem::NotFoundError => e
@@ -64,7 +64,7 @@ class Chef
64
64
  if is_dir
65
65
  return recursive && name != "." && name != ".."
66
66
  elsif ruby_only
67
- return false if name[-3..-1] != ".rb"
67
+ return false if name[-3..] != ".rb"
68
68
  end
69
69
 
70
70
  # Check chefignore
@@ -47,7 +47,7 @@ class Chef
47
47
  v2
48
48
  end
49
49
  end
50
- cookbook_gems[args.first] += args[1..-1]
50
+ cookbook_gems[args.first] += args[1..]
51
51
  end
52
52
  end
53
53
 
@@ -19,7 +19,7 @@
19
19
  require_relative "base"
20
20
  require_relative "../platform/query_helpers"
21
21
  require_relative "../win32/eventlog"
22
- require "chef-utils" unless defined?(ChefUtils)
22
+ require "chef-utils" unless defined?(ChefUtils::CANARY)
23
23
 
24
24
  class Chef
25
25
  module EventLoggers
@@ -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].scrub
79
+ i.nil? ? "" : b[i..].scrub
80
80
  end
81
81
 
82
82
  # Returns the possible directories for the tempfile to be created in.
@@ -16,7 +16,7 @@
16
16
  # See the License for the specific language governing permissions and
17
17
  # limitations under the License.
18
18
  #
19
- require "chef-utils" unless defined?(ChefUtils)
19
+ require "chef-utils" unless defined?(ChefUtils::CANARY)
20
20
 
21
21
  class Chef
22
22
  module Formatters
@@ -20,7 +20,7 @@ class Chef
20
20
  # pastel.decorate is a lightweight replacement for highline.color
21
21
  def pastel
22
22
  @pastel ||= begin
23
- require "pastel"
23
+ require "pastel" unless defined?(Pastel)
24
24
  Pastel.new
25
25
  end
26
26
  end
@@ -126,7 +126,7 @@ class Chef
126
126
  indent_line(options)
127
127
 
128
128
  # Note that the next line will need to be started
129
- if line[-1..-1] == "\n"
129
+ if line[-1..] == "\n"
130
130
  @line_started = false
131
131
  end
132
132
 
@@ -70,7 +70,7 @@ class Chef
70
70
  # pastel.decorate is a lightweight replacement for highline.color
71
71
  def pastel
72
72
  @pastel ||= begin
73
- require "pastel"
73
+ require "pastel" unless defined?(Pastel)
74
74
  Pastel.new
75
75
  end
76
76
  end
@@ -45,7 +45,7 @@ class Chef
45
45
 
46
46
  # Set policy name and group to node
47
47
  def set_policy(node)
48
- policy_group, policy_name = @name_args[1..-1]
48
+ policy_group, policy_name = @name_args[1..]
49
49
  node.policy_name = policy_name
50
50
  node.policy_group = policy_group
51
51
  end
@@ -70,7 +70,7 @@ class Chef
70
70
 
71
71
  # True if one of policy_name or policy_group was given, but not both
72
72
  def incomplete_policyfile_options?
73
- policy_group, policy_name = @name_args[1..-1]
73
+ policy_group, policy_name = @name_args[1..]
74
74
  (policy_group.nil? || policy_name.nil? || @name_args[1..-1].size > 2)
75
75
  end
76
76
 
@@ -43,7 +43,7 @@ class Chef
43
43
  node = Chef::Node.load(@name_args[0])
44
44
  if @name_args.size > 2
45
45
  # Check for nested lists and create a single plain one
46
- entries = @name_args[1..-1].map do |entry|
46
+ entries = @name_args[1..].map do |entry|
47
47
  entry.split(",").map(&:strip)
48
48
  end.flatten
49
49
  else
@@ -34,7 +34,7 @@ class Chef
34
34
 
35
35
  if @name_args.size > 2
36
36
  # Check for nested lists and create a single plain one
37
- entries = @name_args[1..-1].map do |entry|
37
+ entries = @name_args[1..].map do |entry|
38
38
  entry.split(",").map(&:strip)
39
39
  end.flatten
40
40
  else
@@ -36,7 +36,7 @@ class Chef
36
36
  exit 1
37
37
  elsif @name_args.size > 2
38
38
  # Check for nested lists and create a single plain one
39
- entries = @name_args[1..-1].map do |entry|
39
+ entries = @name_args[1..].map do |entry|
40
40
  entry.split(",").map(&:strip)
41
41
  end.flatten
42
42
  else
@@ -68,7 +68,7 @@ class Chef
68
68
 
69
69
  if @name_args.size > 2
70
70
  # Check for nested lists and create a single plain one
71
- entries = @name_args[2..-1].map do |entry|
71
+ entries = @name_args[2..].map do |entry|
72
72
  entry.split(",").map(&:strip)
73
73
  end.flatten
74
74
  else
@@ -51,7 +51,7 @@ class Chef
51
51
  exit 1
52
52
  elsif @name_args.size > 2
53
53
  # Check for nested lists and create a single plain one
54
- entries = @name_args[2..-1].map do |entry|
54
+ entries = @name_args[2..].map do |entry|
55
55
  entry.split(",").map(&:strip)
56
56
  end.flatten
57
57
  else
@@ -68,7 +68,7 @@ class Chef
68
68
 
69
69
  if @name_args.size > 1
70
70
  # Check for nested lists and create a single plain one
71
- entries = @name_args[1..-1].map do |entry|
71
+ entries = @name_args[1..].map do |entry|
72
72
  entry.split(",").map(&:strip)
73
73
  end.flatten
74
74
  else
@@ -50,7 +50,7 @@ class Chef
50
50
  exit 1
51
51
  elsif @name_args.size > 1
52
52
  # Check for nested lists and create a single plain one
53
- entries = @name_args[1..-1].map do |entry|
53
+ entries = @name_args[1..].map do |entry|
54
54
  entry.split(",").map(&:strip)
55
55
  end.flatten
56
56
  else
@@ -26,7 +26,6 @@ class Chef
26
26
  include Knife::Core::MultiAttributeReturnOption
27
27
 
28
28
  deps do
29
- require "addressable/uri" unless defined?(Addressable::URI)
30
29
  require_relative "../node"
31
30
  require_relative "../environment"
32
31
  require_relative "../api_client"
@@ -489,7 +489,7 @@ class Chef
489
489
 
490
490
  new_window_cmds = lambda do
491
491
  if session.servers_for.size > 1
492
- [""] + session.servers_for[1..-1].map do |server|
492
+ [""] + session.servers_for[1..].map do |server|
493
493
  if config[:tmux_split]
494
494
  "split-window #{ssh_dest.call(server)}; tmux select-layout tiled"
495
495
  else
@@ -625,7 +625,7 @@ class Chef
625
625
  when "cssh"
626
626
  cssh
627
627
  else
628
- ssh_command(@name_args[1..-1].join(" "))
628
+ ssh_command(@name_args[1..].join(" "))
629
629
  end
630
630
 
631
631
  session.close
@@ -32,7 +32,7 @@ class Chef
32
32
 
33
33
  def run
34
34
  name = @name_args[0]
35
- tags = @name_args[1..-1]
35
+ tags = @name_args[1..]
36
36
 
37
37
  if name.nil? || tags.nil? || tags.empty?
38
38
  show_usage
@@ -32,7 +32,7 @@ class Chef
32
32
 
33
33
  def run
34
34
  name = @name_args[0]
35
- tags = @name_args[1..-1]
35
+ tags = @name_args[1..]
36
36
 
37
37
  if name.nil? || tags.nil? || tags.empty?
38
38
  show_usage
@@ -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 "chef-utils" unless defined?(ChefUtils)
18
+ require "chef-utils" unless defined?(ChefUtils::CANARY)
19
19
  require_relative "config"
20
20
  require_relative "monkey_patches/webrick-utils" if ChefUtils.windows?
21
21
 
@@ -204,7 +204,7 @@ class Chef
204
204
  all_ivars.delete(:@_extension_modules)
205
205
  all_ivars.inject({}) do |ivar_map, ivar_symbol_name|
206
206
  value = instance_variable_get(ivar_symbol_name)
207
- name_without_at = ivar_symbol_name.to_s[1..-1].to_sym
207
+ name_without_at = ivar_symbol_name.to_s[1..].to_sym
208
208
  ivar_map[name_without_at] = value
209
209
  ivar_map
210
210
  end
@@ -17,7 +17,9 @@
17
17
  #
18
18
 
19
19
  autoload :URI, "uri"
20
- autoload :Addressable, "addressable/uri"
20
+ module Addressable
21
+ autoload :URI, "addressable/uri"
22
+ end
21
23
 
22
24
  class Chef
23
25
  module Mixin
@@ -225,13 +225,13 @@ class Chef
225
225
 
226
226
  if attribute == :platform_family
227
227
  # If any blocklist value matches, we don't match
228
- return false if blocklist.any? { |v| v[1..-1] == value || platform_family_query_helper?(node, v[1..-1]) }
228
+ return false if blocklist.any? { |v| v[1..] == value || platform_family_query_helper?(node, v[1..]) }
229
229
 
230
230
  # If the allowlist is empty, or anything matches, we match.
231
231
  allowlist.empty? || allowlist.any? { |v| v == :all || v == value || platform_family_query_helper?(node, v) }
232
232
  else
233
233
  # If any blocklist value matches, we don't match
234
- return false if blocklist.any? { |v| v[1..-1] == value }
234
+ return false if blocklist.any? { |v| v[1..] == value }
235
235
 
236
236
  # If the allowlist is empty, or anything matches, we match.
237
237
  allowlist.empty? || allowlist.any? { |v| v == :all || v == value }
@@ -23,6 +23,8 @@ require_relative "../run_context"
23
23
  require_relative "../config"
24
24
  require_relative "../node"
25
25
  require_relative "../exceptions"
26
+ require_relative "expand_node_object"
27
+ require_relative "policyfile"
26
28
 
27
29
  class Chef
28
30
  module PolicyBuilder
@@ -88,7 +88,7 @@ class Chef
88
88
  def self.use(partial)
89
89
  dirname = ::File.dirname(partial)
90
90
  basename = ::File.basename(partial, ".rb")
91
- basename = basename[1..-1] if basename.start_with?("_")
91
+ basename = basename[1..] if basename.start_with?("_")
92
92
  class_eval IO.read(::File.expand_path("#{dirname}/_#{basename}.rb", ::File.dirname(caller_locations.first.absolute_path)))
93
93
  end
94
94
 
@@ -31,7 +31,7 @@ require_relative "../util/backup"
31
31
  require_relative "../util/diff"
32
32
  require_relative "../util/selinux"
33
33
  require_relative "../file_content_management/deploy"
34
- require "chef-utils" unless defined?(ChefUtils)
34
+ require "chef-utils" unless defined?(ChefUtils::CANARY)
35
35
 
36
36
  # The Tao of File Providers:
37
37
  # - the content provider must always return a tempfile that we can delete/mv
@@ -33,15 +33,6 @@ class Chef
33
33
  include Chef::Mixin::EnforceOwnershipAndPermissions
34
34
  include Chef::Mixin::FileClass
35
35
 
36
- def negative_complement(big)
37
- if big > 1073741823 # Fixnum max
38
- big -= (2**32) # diminished radix wrap to negative
39
- end
40
- big
41
- end
42
-
43
- private :negative_complement
44
-
45
36
  def load_current_resource
46
37
  @current_resource = Chef::Resource::Link.new(new_resource.name)
47
38
  current_resource.target_file(new_resource.target_file)
@@ -164,10 +164,7 @@ class Chef
164
164
  #
165
165
  # @return [Hash] Mapping of package names to sources
166
166
  def name_sources
167
- @name_sources =
168
- begin
169
- Hash[*package_name_array.zip(resolved_source_array).flatten]
170
- end
167
+ @name_sources ||= Hash[*package_name_array.zip(resolved_source_array).flatten]
171
168
  end
172
169
 
173
170
  # Helper to construct Hash of names-to-package-information.
@@ -186,17 +183,11 @@ class Chef
186
183
  end
187
184
 
188
185
  def name_candidate_version
189
- @name_candidate_version ||=
190
- begin
191
- Hash[name_pkginfo.map { |k, v| [k, v ? v.split("\t")[1].strip : nil] }]
192
- end
186
+ @name_candidate_version ||= name_pkginfo.transform_values { |v| v ? v.split("\t")[1]&.strip : nil }
193
187
  end
194
188
 
195
189
  def name_package_name
196
- @name_package_name ||=
197
- begin
198
- Hash[name_pkginfo.map { |k, v| [k, v ? v.split("\t")[0] : nil] }]
199
- end
190
+ @name_package_name ||= name_pkginfo.transform_values { |v| v ? v.split("\t")[0] : nil }
200
191
  end
201
192
 
202
193
  # Return candidate version array from pkg-deb -W against the source file(s).
@@ -127,7 +127,7 @@ class Chef
127
127
 
128
128
  # check each item in the hash to see if we were passed an alias
129
129
  brew_info.each_value do |p|
130
- return p if p["aliases"].include?(package_name)
130
+ return p if p["full_name"] == package_name || p["aliases"].include?(package_name)
131
131
  end
132
132
 
133
133
  {}
@@ -84,7 +84,7 @@ class Chef
84
84
  chkconfig = shell_out!("/sbin/chkconfig --list #{current_resource.service_name}", returns: [0, 1])
85
85
  unless run_levels.nil? || run_levels.empty?
86
86
  all_levels_match = true
87
- chkconfig.stdout.split(/\s+/)[1..-1].each do |level|
87
+ chkconfig.stdout.split(/\s+/)[1..].each do |level|
88
88
  index = level.split(":").first
89
89
  status = level.split(":").last
90
90
  if CHKCONFIG_ON.match?(level)
@@ -584,7 +584,7 @@ in 'password', with the associated 'salt' and 'iterations'.")
584
584
  #
585
585
 
586
586
  def run_dscl(*args)
587
- result = shell_out("dscl", ".", "-#{args[0]}", args[1..-1])
587
+ result = shell_out("dscl", ".", "-#{args[0]}", args[1..])
588
588
  return "" if ( args.first =~ /^delete/ ) && ( result.exitstatus != 0 )
589
589
  raise(Chef::Exceptions::DsclCommandFailed, "dscl error: #{result.inspect}") unless result.exitstatus == 0
590
590
  raise(Chef::Exceptions::DsclCommandFailed, "dscl error: #{result.inspect}") if result.stdout.include?("No such key: ")
@@ -593,7 +593,7 @@ in 'password', with the associated 'salt' and 'iterations'.")
593
593
  end
594
594
 
595
595
  def run_plutil(*args)
596
- result = shell_out("plutil", "-#{args[0]}", args[1..-1])
596
+ result = shell_out("plutil", "-#{args[0]}", args[1..])
597
597
  raise(Chef::Exceptions::PlistUtilCommandFailed, "plutil error: #{result.inspect}") unless result.exitstatus == 0
598
598
 
599
599
  if result.stdout.encoding == Encoding::ASCII_8BIT
@@ -608,7 +608,7 @@ class Chef
608
608
  end
609
609
 
610
610
  def run_dscl(*args)
611
- result = shell_out("dscl", "-plist", ".", "-#{args[0]}", args[1..-1])
611
+ result = shell_out("dscl", "-plist", ".", "-#{args[0]}", args[1..])
612
612
  return "" if ( args.first =~ /^delete/ ) && ( result.exitstatus != 0 )
613
613
  raise(Chef::Exceptions::DsclCommandFailed, "dscl error: #{result.inspect}") unless result.exitstatus == 0
614
614
  raise(Chef::Exceptions::DsclCommandFailed, "dscl error: #{result.inspect}") if /No such key: /.match?(result.stdout)
@@ -617,7 +617,7 @@ class Chef
617
617
  end
618
618
 
619
619
  def run_plutil(*args)
620
- result = shell_out("plutil", "-#{args[0]}", args[1..-1])
620
+ result = shell_out("plutil", "-#{args[0]}", args[1..])
621
621
  raise(Chef::Exceptions::PlistUtilCommandFailed, "plutil error: #{result.inspect}") unless result.exitstatus == 0
622
622
 
623
623
  result.stdout
@@ -1480,7 +1480,7 @@ class Chef
1480
1480
  def self.use(partial)
1481
1481
  dirname = ::File.dirname(partial)
1482
1482
  basename = ::File.basename(partial, ".rb")
1483
- basename = basename[1..-1] if basename.start_with?("_")
1483
+ basename = basename[1..] if basename.start_with?("_")
1484
1484
  class_eval IO.read(::File.expand_path("#{dirname}/_#{basename}.rb", ::File.dirname(caller_locations.first.absolute_path)))
1485
1485
  end
1486
1486
 
@@ -19,7 +19,9 @@
19
19
  require_relative "../resource"
20
20
  require_relative "../http/simple"
21
21
  require "tmpdir" unless defined?(Dir.mktmpdir)
22
- autoload :Addressable, "addressable"
22
+ module Addressable
23
+ autoload :URI, "addressable/uri"
24
+ end
23
25
 
24
26
  class Chef
25
27
  class Resource
@@ -168,7 +170,7 @@ class Chef
168
170
  # is the provided ID a key ID from a keyserver. Looks at length and HEX only values
169
171
  # @param [String] id the key value passed by the user that *may* be an ID
170
172
  def is_key_id?(id)
171
- id = id[2..-1] if id.start_with?("0x")
173
+ id = id[2..] if id.start_with?("0x")
172
174
  id =~ /^\h+$/ && [8, 16, 40].include?(id.length)
173
175
  end
174
176
 
@@ -102,6 +102,7 @@ class Chef
102
102
 
103
103
  This recipe will generate report output similar to the following:
104
104
 
105
+ ```
105
106
  [2013-11-26T03:11:06+00:00] INFO: Chef Infra Client Run complete in 0.300029878 seconds
106
107
  [2013-11-26T03:11:06+00:00] INFO: Running report handlers
107
108
  [2013-11-26T03:11:06+00:00] INFO: Cookbooks and versions run: ["cookbook_versions_handler 1.0.0"]
@@ -89,6 +89,7 @@ property :time_out, Hash,
89
89
  }
90
90
 
91
91
  private
92
+
92
93
  # Convert weekday input value into crontab format that
93
94
  # could be written in the crontab
94
95
  # @return [Integer, String] A weekday formed as per the user inputs.
@@ -22,7 +22,7 @@ require_relative "../platform/query_helpers"
22
22
  require_relative "../mixin/securable"
23
23
  require_relative "file/verification"
24
24
  require "pathname" unless defined?(Pathname)
25
- require "chef-utils" unless defined?(ChefUtils)
25
+ require "chef-utils" unless defined?(ChefUtils::CANARY)
26
26
 
27
27
  class Chef
28
28
  class Resource
@@ -19,8 +19,6 @@
19
19
  # limitations under the License.
20
20
  #
21
21
 
22
- require "uri" unless defined?(URI)
23
- require "securerandom" unless defined?(SecureRandom)
24
22
  require_relative "event_dispatch/base"
25
23
 
26
24
  class Chef
@@ -23,7 +23,7 @@ end
23
23
  require_relative "config"
24
24
  require_relative "exceptions"
25
25
  require "timeout" unless defined?(Timeout)
26
- require "chef-utils" unless defined?(ChefUtils)
26
+ require "chef-utils" unless defined?(ChefUtils::CANARY)
27
27
 
28
28
  class Chef
29
29
 
@@ -21,7 +21,9 @@ require_relative "../exceptions"
21
21
  require_relative "../server_api"
22
22
 
23
23
  autoload :URI, "uri"
24
- autoload :Addressable, "addressable/uri"
24
+ module Addressable
25
+ autoload :URI, "addressable/uri"
26
+ end
25
27
 
26
28
  class Chef
27
29
  class Search
@@ -36,7 +36,7 @@ class Chef
36
36
  slice_number = @new_resource.backup
37
37
  backup_files = sorted_backup_files
38
38
  if backup_files.length >= @new_resource.backup
39
- remainder = backup_files.slice(slice_number..-1)
39
+ remainder = backup_files.slice(slice_number..)
40
40
  remainder.each do |backup_to_delete|
41
41
  delete_backup(backup_to_delete)
42
42
  end
@@ -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("16.5.64")
26
+ VERSION = Chef::VersionString.new("16.5.77")
27
27
  end
28
28
 
29
29
  #
@@ -124,7 +124,7 @@ class Chef
124
124
  # Return the link destination (strip off \??\ at the beginning, which is a local filesystem thing)
125
125
  link_dest = reparse_buffer.reparse_buffer.substitute_name
126
126
  if /^\\\?\?\\/.match?(link_dest)
127
- link_dest = link_dest[4..-1]
127
+ link_dest = link_dest[4..]
128
128
  end
129
129
  link_dest
130
130
  end
@@ -40,7 +40,7 @@ module FFI
40
40
  last_char = nil
41
41
  while last_char != "\000\000"
42
42
  length += 1
43
- last_char = get_bytes(0, length * 2)[-2..-1]
43
+ last_char = get_bytes(0, length * 2)[-2..]
44
44
  end
45
45
 
46
46
  num_wchars = length
@@ -68,7 +68,7 @@ end
68
68
 
69
69
  # If you want to load anything into the testing environment
70
70
  # without versioning it, add it to spec/support/local_gems.rb
71
- require "spec/support/local_gems.rb" if File.exist?(File.join(File.dirname(__FILE__), "support", "local_gems.rb"))
71
+ require "spec/support/local_gems" if File.exist?(File.join(File.dirname(__FILE__), "support", "local_gems.rb"))
72
72
 
73
73
  # Explicitly require spec helpers that need to load first
74
74
  require "spec/support/platform_helpers"
@@ -309,8 +309,6 @@ RSpec.configure do |config|
309
309
  end
310
310
 
311
311
  require "webrick/utils"
312
- require "thread"
313
-
314
312
  # Webrick uses a centralized/synchronized timeout manager. It works by
315
313
  # starting a thread to check for timeouts on an interval. The timeout
316
314
  # checker thread cannot be stopped or canceled in any easy way, and it
@@ -18,7 +18,7 @@
18
18
 
19
19
  require "spec_helper"
20
20
  require "chef/exceptions"
21
- require "lib/chef/chef_fs/config.rb"
21
+ require "lib/chef/chef_fs/config"
22
22
 
23
23
  describe Chef::ChefFS::Config do
24
24
  describe "initialize" do
@@ -17,7 +17,7 @@
17
17
  #
18
18
 
19
19
  require "spec_helper"
20
- require "lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb"
20
+ require "lib/chef/chef_fs/data_handler/data_bag_item_data_handler"
21
21
 
22
22
  class TestDataBag < Mash
23
23
  attr_accessor :name
@@ -26,10 +26,6 @@ require "socket"
26
26
  # actually running -- another testing requirement similar to the integration testing framework in cheffish as well)
27
27
  #
28
28
  describe Chef::DataCollector do
29
- before(:each) do
30
- Chef::Config[:enable_reporting] = true
31
- end
32
-
33
29
  let(:node) { Chef::Node.new }
34
30
 
35
31
  let(:rest_client) { double("Chef::ServerAPI (mock)") }
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: 16.5.64
4
+ version: 16.5.77
5
5
  platform: universal-mingw32
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-17 00:00:00.000000000 Z
11
+ date: 2020-09-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: 16.5.64
19
+ version: 16.5.77
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: 16.5.64
26
+ version: 16.5.77
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: 16.5.64
33
+ version: 16.5.77
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: 16.5.64
40
+ version: 16.5.77
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: train-core
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -376,14 +376,14 @@ dependencies:
376
376
  requirements:
377
377
  - - "~>"
378
378
  - !ruby/object:Gem::Version
379
- version: 0.11.0
379
+ version: '0.11'
380
380
  type: :runtime
381
381
  prerelease: false
382
382
  version_requirements: !ruby/object:Gem::Requirement
383
383
  requirements:
384
384
  - - "~>"
385
385
  - !ruby/object:Gem::Version
386
- version: 0.11.0
386
+ version: '0.11'
387
387
  - !ruby/object:Gem::Dependency
388
388
  name: pastel
389
389
  requirement: !ruby/object:Gem::Requirement