diff options
82 files changed, 79 insertions, 77 deletions
@@ -26,8 +26,7 @@ begin require_relative "tasks/announce" require_relative "tasks/docs" require_relative "tasks/spellcheck" - require_relative "lib/chef/dist" - require "chef-utils" + require_relative "chef-utils/lib/chef-utils/dist" rescue LoadError => e puts "Skipping missing rake dep: #{e}" end diff --git a/chef-config/lib/chef-config/mixin/credentials.rb b/chef-config/lib/chef-config/mixin/credentials.rb index b7c83a7611..13f490ba71 100644 --- a/chef-config/lib/chef-config/mixin/credentials.rb +++ b/chef-config/lib/chef-config/mixin/credentials.rb @@ -17,6 +17,7 @@ autoload :Tomlrb, "tomlrb" require_relative "../path_helper" +require "chef-utils/dist/infra" module ChefConfig module Mixin diff --git a/chef-utils/lib/chef-utils/dist/infra.rb b/chef-utils/lib/chef-utils/dist/infra.rb index 7b2c4e6fa7..55b7c8f951 100644 --- a/chef-utils/lib/chef-utils/dist/infra.rb +++ b/chef-utils/lib/chef-utils/dist/infra.rb @@ -24,7 +24,7 @@ module ChefUtils SHELL = "chef-shell".freeze # The chef-shell default configuration file - SHELL_CONF ="chef_shell.rb".freeze + SHELL_CONF = "chef_shell.rb".freeze # chef-zero executable ZERO = "Chef Infra Zero".freeze diff --git a/lib/chef/application/apply.rb b/lib/chef/application/apply.rb index 3641f7a3f3..2c36adc191 100644 --- a/lib/chef/application/apply.rb +++ b/lib/chef/application/apply.rb @@ -27,7 +27,7 @@ require "fileutils" unless defined?(FileUtils) require "tempfile" unless defined?(Tempfile) require_relative "../providers" require_relative "../resources" -require "chef-utils" +require "chef-utils/dist" require "license_acceptance/cli_flags/mixlib_cli" class Chef::Application::Apply < Chef::Application diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb index 70477722f4..77b8de3d0d 100644 --- a/lib/chef/application/client.rb +++ b/lib/chef/application/client.rb @@ -21,6 +21,7 @@ require_relative "base" require_relative "../handler/error_report" require_relative "../workstation_config_loader" autoload :URI, "uri" +require "chef-utils" module Mixlib module Authentication autoload :Log, "mixlib/authentication" diff --git a/lib/chef/application/exit_code.rb b/lib/chef/application/exit_code.rb index ed83d51b59..c634ba2b58 100644 --- a/lib/chef/application/exit_code.rb +++ b/lib/chef/application/exit_code.rb @@ -22,7 +22,7 @@ class Chef # These are the exit codes defined in Chef RFC 062 # https://github.com/chef/chef-rfc/blob/master/rfc062-exit-status.md class ExitCode - require "chef-utils" + require "chef-utils/dist/infra" # -1 is defined as DEPRECATED_FAILURE in RFC 062, so it is # not enumerated in an active constant. diff --git a/lib/chef/application/knife.rb b/lib/chef/application/knife.rb index af6d352937..d4e3d179b2 100644 --- a/lib/chef/application/knife.rb +++ b/lib/chef/application/knife.rb @@ -22,7 +22,7 @@ require "ohai/config" module Net autoload :HTTP, File.expand_path("../monkey_patches/net_http", __dir__) end -require "chef-utils" +require "chef-utils/dist" class Chef::Application::Knife < Chef::Application diff --git a/lib/chef/application/solo.rb b/lib/chef/application/solo.rb index e514c7063f..d495f3ff8d 100644 --- a/lib/chef/application/solo.rb +++ b/lib/chef/application/solo.rb @@ -21,6 +21,7 @@ require_relative "../../chef" require_relative "client" require "fileutils" unless defined?(FileUtils) require "pathname" unless defined?(Pathname) +require "chef-utils" # DO NOT MAKE EDITS, see Chef::Application::Base # diff --git a/lib/chef/application/windows_service.rb b/lib/chef/application/windows_service.rb index 49ab3d2855..8332b1e747 100644 --- a/lib/chef/application/windows_service.rb +++ b/lib/chef/application/windows_service.rb @@ -29,7 +29,7 @@ require "socket" unless defined?(Socket) require "uri" unless defined?(URI) require "win32/daemon" require_relative "../mixin/shell_out" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Application diff --git a/lib/chef/application/windows_service_manager.rb b/lib/chef/application/windows_service_manager.rb index d28028bcc1..5bbebd62e2 100644 --- a/lib/chef/application/windows_service_manager.rb +++ b/lib/chef/application/windows_service_manager.rb @@ -21,7 +21,7 @@ if RUBY_PLATFORM.match?(/mswin|mingw32|windows/) end require_relative "../config" require "mixlib/cli" unless defined?(Mixlib::CLI) -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Application diff --git a/lib/chef/chef_fs/knife.rb b/lib/chef/chef_fs/knife.rb index d1b3f3d64a..168f3647f6 100644 --- a/lib/chef/chef_fs/knife.rb +++ b/lib/chef/chef_fs/knife.rb @@ -18,7 +18,7 @@ require_relative "../knife" require "pathname" unless defined?(Pathname) -require "chef-utils" +require "chef-utils/dist/infra" class Chef module ChefFS diff --git a/lib/chef/cookbook/synchronizer.rb b/lib/chef/cookbook/synchronizer.rb index 44aff4ab5a..04040d74d8 100644 --- a/lib/chef/cookbook/synchronizer.rb +++ b/lib/chef/cookbook/synchronizer.rb @@ -17,7 +17,7 @@ require_relative "../client" require_relative "../util/threaded_job_queue" require_relative "../server_api" require "singleton" unless defined?(Singleton) -require "chef-utils" +require "chef-utils/dist/infra" class Chef diff --git a/lib/chef/cookbook_site_streaming_uploader.rb b/lib/chef/cookbook_site_streaming_uploader.rb index dcb914eb6c..6041c6c459 100644 --- a/lib/chef/cookbook_site_streaming_uploader.rb +++ b/lib/chef/cookbook_site_streaming_uploader.rb @@ -28,7 +28,7 @@ module Mixlib autoload :SignedHeaderAuth, "mixlib/authentication/signedheaderauth" end end -require "chef-utils" +require "chef-utils/dist/infra" class Chef # == Chef::CookbookSiteStreamingUploader diff --git a/lib/chef/data_collector.rb b/lib/chef/data_collector.rb index a44ebf07bb..41da9c2ed5 100644 --- a/lib/chef/data_collector.rb +++ b/lib/chef/data_collector.rb @@ -26,7 +26,7 @@ require_relative "data_collector/run_end_message" require_relative "data_collector/run_start_message" require_relative "data_collector/config_validation" require_relative "data_collector/error_handlers" -require "chef-utils" +require "chef-utils/dist/automate" class Chef class DataCollector diff --git a/lib/chef/data_collector/config_validation.rb b/lib/chef/data_collector/config_validation.rb index ec612e052d..09cf6b8664 100644 --- a/lib/chef/data_collector/config_validation.rb +++ b/lib/chef/data_collector/config_validation.rb @@ -16,6 +16,7 @@ # require "uri" unless defined?(URI) +require "chef-utils/dist" class Chef class DataCollector diff --git a/lib/chef/deprecation/warnings.rb b/lib/chef/deprecation/warnings.rb index 35f1394757..f1033270a4 100644 --- a/lib/chef/deprecation/warnings.rb +++ b/lib/chef/deprecation/warnings.rb @@ -21,7 +21,7 @@ class Chef module Warnings require_relative "../version" - require "chef-utils" + require "chef-utils/dist/infra" def add_deprecation_warnings_for(method_names) method_names.each do |name| diff --git a/lib/chef/environment.rb b/lib/chef/environment.rb index b952076b2b..4d8584363a 100644 --- a/lib/chef/environment.rb +++ b/lib/chef/environment.rb @@ -25,7 +25,7 @@ require_relative "mixin/params_validate" require_relative "mixin/from_file" require_relative "version_constraint" require_relative "server_api" -require "chef-utils" +require "chef-utils/dist/solo" class Chef class Environment diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb index 93cda03e75..c93dead219 100644 --- a/lib/chef/exceptions.rb +++ b/lib/chef/exceptions.rb @@ -18,7 +18,7 @@ # limitations under the License. require "chef-config/exceptions" -require "chef-utils" +require "chef-utils/dist/infra" require_relative "constants" class Chef diff --git a/lib/chef/formatters/doc.rb b/lib/chef/formatters/doc.rb index 86bc6f7bba..6d923a12ac 100644 --- a/lib/chef/formatters/doc.rb +++ b/lib/chef/formatters/doc.rb @@ -1,6 +1,6 @@ require_relative "base" require_relative "../config" -require "chef-utils" +require "chef-utils/dist/infra" class Chef module Formatters diff --git a/lib/chef/formatters/error_inspectors/api_error_formatting.rb b/lib/chef/formatters/error_inspectors/api_error_formatting.rb index d89503bc0d..654aeb67b0 100644 --- a/lib/chef/formatters/error_inspectors/api_error_formatting.rb +++ b/lib/chef/formatters/error_inspectors/api_error_formatting.rb @@ -17,7 +17,7 @@ # require_relative "../../http/authenticator" -require "chef-utils" +require "chef-utils/dist" require "timeout" unless defined?(Timeout) class Chef diff --git a/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb b/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb index 9f6902ed12..442bbbc322 100644 --- a/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb +++ b/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb @@ -17,7 +17,7 @@ # require_relative "api_error_formatting" -require "chef-utils" +require "chef-utils/dist" class Chef module Formatters diff --git a/lib/chef/formatters/error_inspectors/registration_error_inspector.rb b/lib/chef/formatters/error_inspectors/registration_error_inspector.rb index c62f59c072..f7c8a90b67 100644 --- a/lib/chef/formatters/error_inspectors/registration_error_inspector.rb +++ b/lib/chef/formatters/error_inspectors/registration_error_inspector.rb @@ -1,4 +1,4 @@ -require "chef-utils" +require "chef-utils/dist" class Chef module Formatters diff --git a/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb b/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb index c5f02402a4..ae96a47aad 100644 --- a/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb +++ b/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb @@ -18,7 +18,7 @@ # require_relative "api_error_formatting" -require "chef-utils" +require "chef-utils/dist/server" class Chef module Formatters diff --git a/lib/chef/formatters/minimal.rb b/lib/chef/formatters/minimal.rb index 39fe93fc67..92c33aa69b 100644 --- a/lib/chef/formatters/minimal.rb +++ b/lib/chef/formatters/minimal.rb @@ -1,5 +1,5 @@ require_relative "base" -require "chef-utils" +require "chef-utils/dist/infra" class Chef diff --git a/lib/chef/http/http_request.rb b/lib/chef/http/http_request.rb index ef12630045..3bafaca667 100644 --- a/lib/chef/http/http_request.rb +++ b/lib/chef/http/http_request.rb @@ -25,7 +25,7 @@ autoload :CGI, "cgi" module Net autoload :HTTP, File.expand_path("../monkey_patches/net_http", __dir__) end -require "chef-utils" +require "chef-utils/dist/org" # To load faster, we only want ohai's version string. # However, in ohai before 0.6.0, the version is defined diff --git a/lib/chef/http/socketless_chef_zero_client.rb b/lib/chef/http/socketless_chef_zero_client.rb index 6f43390f8d..01f8d8c648 100644 --- a/lib/chef/http/socketless_chef_zero_client.rb +++ b/lib/chef/http/socketless_chef_zero_client.rb @@ -44,7 +44,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. require "chef_zero/server" -require "chef-utils" +require "chef-utils/dist/zero" module Net autoload :HTTPResponse, File.expand_path("../monkey_patches/net_http", __dir__) end diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb index 8fb4525d42..64943b5a23 100644 --- a/lib/chef/knife/bootstrap.rb +++ b/lib/chef/knife/bootstrap.rb @@ -18,7 +18,7 @@ require_relative "../knife" require_relative "data_bag_secret_options" -require "chef-utils" +require "chef-utils/dist" require "license_acceptance/cli_flags/mixlib_cli" module LicenseAcceptance autoload :Acceptor, "license_acceptance/acceptor" diff --git a/lib/chef/knife/client_create.rb b/lib/chef/knife/client_create.rb index a30b76c10b..4fe3bbeb02 100644 --- a/lib/chef/knife/client_create.rb +++ b/lib/chef/knife/client_create.rb @@ -17,7 +17,7 @@ # require_relative "../knife" -require "chef-utils" +require "chef-utils/dist/server" class Chef class Knife diff --git a/lib/chef/knife/configure.rb b/lib/chef/knife/configure.rb index 9bab33f005..dad54ce133 100644 --- a/lib/chef/knife/configure.rb +++ b/lib/chef/knife/configure.rb @@ -17,7 +17,7 @@ # require_relative "../knife" -require "chef-utils" +require "chef-utils/dist/server" class Chef class Knife diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb index de4d3e4841..14e7374b0e 100644 --- a/lib/chef/knife/core/bootstrap_context.rb +++ b/lib/chef/knife/core/bootstrap_context.rb @@ -19,7 +19,7 @@ require_relative "../../run_list" require_relative "../../util/path_helper" require "pathname" unless defined?(Pathname) -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Knife diff --git a/lib/chef/knife/core/windows_bootstrap_context.rb b/lib/chef/knife/core/windows_bootstrap_context.rb index 5af508f8dc..15c4bd3020 100644 --- a/lib/chef/knife/core/windows_bootstrap_context.rb +++ b/lib/chef/knife/core/windows_bootstrap_context.rb @@ -18,7 +18,7 @@ require_relative "bootstrap_context" require_relative "../../util/path_helper" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Knife diff --git a/lib/chef/knife/exec.rb b/lib/chef/knife/exec.rb index 01f619e156..b42cc7d8f1 100644 --- a/lib/chef/knife/exec.rb +++ b/lib/chef/knife/exec.rb @@ -17,7 +17,7 @@ # require_relative "../knife" -require "chef-utils" +require "chef-utils/dist/infra" class Chef::Knife::Exec < Chef::Knife diff --git a/lib/chef/knife/node_show.rb b/lib/chef/knife/node_show.rb index bbcc38f39a..e87d7b165e 100644 --- a/lib/chef/knife/node_show.rb +++ b/lib/chef/knife/node_show.rb @@ -18,7 +18,7 @@ require_relative "../knife" require_relative "core/node_presenter" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Knife diff --git a/lib/chef/knife/serve.rb b/lib/chef/knife/serve.rb index 3741b3cf30..c127e1ed16 100644 --- a/lib/chef/knife/serve.rb +++ b/lib/chef/knife/serve.rb @@ -16,7 +16,7 @@ require_relative "../knife" require_relative "../local_mode" -require "chef-utils" +require "chef-utils/dist" class Chef class Knife diff --git a/lib/chef/knife/ssl_check.rb b/lib/chef/knife/ssl_check.rb index 29e8cedb5d..d9bd9b0857 100644 --- a/lib/chef/knife/ssl_check.rb +++ b/lib/chef/knife/ssl_check.rb @@ -17,7 +17,7 @@ # require_relative "../knife" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Knife diff --git a/lib/chef/knife/status.rb b/lib/chef/knife/status.rb index e318f37825..b67d9b811a 100644 --- a/lib/chef/knife/status.rb +++ b/lib/chef/knife/status.rb @@ -19,7 +19,7 @@ require_relative "../knife" require_relative "core/status_presenter" require_relative "core/node_presenter" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Knife diff --git a/lib/chef/knife/user_create.rb b/lib/chef/knife/user_create.rb index bbd24d6706..83ed21296f 100644 --- a/lib/chef/knife/user_create.rb +++ b/lib/chef/knife/user_create.rb @@ -18,7 +18,7 @@ # require_relative "../knife" -require "chef-utils" +require "chef-utils/dist/server" class Chef class Knife diff --git a/lib/chef/local_mode.rb b/lib/chef/local_mode.rb index df615df2b7..da8655a02f 100644 --- a/lib/chef/local_mode.rb +++ b/lib/chef/local_mode.rb @@ -15,9 +15,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +require "chef-utils" require_relative "config" require_relative "monkey_patches/webrick-utils" if ChefUtils.windows? -require "chef-utils" class Chef module LocalMode diff --git a/lib/chef/log/syslog.rb b/lib/chef/log/syslog.rb index 8c22fbf3da..a024b05b53 100644 --- a/lib/chef/log/syslog.rb +++ b/lib/chef/log/syslog.rb @@ -19,7 +19,7 @@ require "logger" require "syslog-logger" require_relative "../mixin/unformatter" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Log diff --git a/lib/chef/log/winevt.rb b/lib/chef/log/winevt.rb index 2b3e5c97a5..300544205a 100644 --- a/lib/chef/log/winevt.rb +++ b/lib/chef/log/winevt.rb @@ -19,7 +19,7 @@ require_relative "../event_loggers/base" require_relative "../platform/query_helpers" require_relative "../mixin/unformatter" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Log diff --git a/lib/chef/policy_builder/policyfile.rb b/lib/chef/policy_builder/policyfile.rb index 4beea10112..71d00e046f 100644 --- a/lib/chef/policy_builder/policyfile.rb +++ b/lib/chef/policy_builder/policyfile.rb @@ -24,7 +24,7 @@ require_relative "../run_context" require_relative "../config" require_relative "../node" require_relative "../server_api" -require "chef-utils" +require "chef-utils/dist/infra" class Chef module PolicyBuilder diff --git a/lib/chef/provider/package/rubygems.rb b/lib/chef/provider/package/rubygems.rb index bab1413ef0..032f34b0a8 100644 --- a/lib/chef/provider/package/rubygems.rb +++ b/lib/chef/provider/package/rubygems.rb @@ -22,7 +22,7 @@ require_relative "../package" require_relative "../../resource/package" require_relative "../../mixin/get_source_from_package" require_relative "../../mixin/which" -require "chef-utils" +require "chef-utils/dist/infra" # Class methods on Gem are defined in rubygems autoload :Gem, "rubygems" diff --git a/lib/chef/provider/zypper_repository.rb b/lib/chef/provider/zypper_repository.rb index 1c557acda0..fea179e670 100644 --- a/lib/chef/provider/zypper_repository.rb +++ b/lib/chef/provider/zypper_repository.rb @@ -20,7 +20,7 @@ require_relative "../resource" require_relative "../dsl/declare_resource" require_relative "noop" require "shellwords" unless defined?(Shellwords) -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Provider diff --git a/lib/chef/resource/breakpoint.rb b/lib/chef/resource/breakpoint.rb index 4c03579136..0e46d485d6 100644 --- a/lib/chef/resource/breakpoint.rb +++ b/lib/chef/resource/breakpoint.rb @@ -17,7 +17,7 @@ # require_relative "../resource" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/chef_client_cron.rb b/lib/chef/resource/chef_client_cron.rb index a656027492..9f0286c579 100644 --- a/lib/chef/resource/chef_client_cron.rb +++ b/lib/chef/resource/chef_client_cron.rb @@ -15,7 +15,7 @@ # require_relative "../resource" -require "chef-utils" +require "chef-utils/dist/infra" require_relative "helpers/cron_validations" require "digest/md5" unless defined?(Digest::MD5) diff --git a/lib/chef/resource/chef_client_scheduled_task.rb b/lib/chef/resource/chef_client_scheduled_task.rb index c8c97bd865..3450ff2329 100644 --- a/lib/chef/resource/chef_client_scheduled_task.rb +++ b/lib/chef/resource/chef_client_scheduled_task.rb @@ -15,7 +15,7 @@ # require_relative "../resource" -require "chef-utils" +require "chef-utils/dist" class Chef class Resource diff --git a/lib/chef/resource/chef_client_systemd_timer.rb b/lib/chef/resource/chef_client_systemd_timer.rb index 432f29703d..443d0e6ce8 100644 --- a/lib/chef/resource/chef_client_systemd_timer.rb +++ b/lib/chef/resource/chef_client_systemd_timer.rb @@ -15,7 +15,7 @@ # require_relative "../resource" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/chef_handler.rb b/lib/chef/resource/chef_handler.rb index 9666f8e656..cceb04249d 100644 --- a/lib/chef/resource/chef_handler.rb +++ b/lib/chef/resource/chef_handler.rb @@ -16,7 +16,7 @@ # require_relative "../resource" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/chef_sleep.rb b/lib/chef/resource/chef_sleep.rb index 501f8fbfa0..cb3da0df33 100644 --- a/lib/chef/resource/chef_sleep.rb +++ b/lib/chef/resource/chef_sleep.rb @@ -15,7 +15,7 @@ # require_relative "../resource" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/cookbook_file.rb b/lib/chef/resource/cookbook_file.rb index c0e33f80fb..057bd3be6b 100644 --- a/lib/chef/resource/cookbook_file.rb +++ b/lib/chef/resource/cookbook_file.rb @@ -21,7 +21,7 @@ require_relative "file" require_relative "../provider/cookbook_file" require_relative "../mixin/securable" -require "chef-utils" +require "chef-utils/dist" class Chef class Resource diff --git a/lib/chef/resource/cron/cron_d.rb b/lib/chef/resource/cron/cron_d.rb index 681a923acc..8276fb8587 100644 --- a/lib/chef/resource/cron/cron_d.rb +++ b/lib/chef/resource/cron/cron_d.rb @@ -18,7 +18,6 @@ require_relative "../../resource" require_relative "../helpers/cron_validations" require "shellwords" unless defined?(Shellwords) -require "chef-utils" class Chef class Resource diff --git a/lib/chef/resource/dnf_package.rb b/lib/chef/resource/dnf_package.rb index 53f05f280d..03523c614d 100644 --- a/lib/chef/resource/dnf_package.rb +++ b/lib/chef/resource/dnf_package.rb @@ -18,7 +18,7 @@ require_relative "package" require_relative "../mixin/which" require_relative "../mixin/shell_out" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/dsc_resource.rb b/lib/chef/resource/dsc_resource.rb index 2aaf9c16a4..679deef47b 100644 --- a/lib/chef/resource/dsc_resource.rb +++ b/lib/chef/resource/dsc_resource.rb @@ -16,7 +16,6 @@ # limitations under the License. # require_relative "../dsl/powershell" -require "chef-utils" class Chef class Resource diff --git a/lib/chef/resource/dsc_script.rb b/lib/chef/resource/dsc_script.rb index 5b574e3606..cf35714931 100644 --- a/lib/chef/resource/dsc_script.rb +++ b/lib/chef/resource/dsc_script.rb @@ -19,7 +19,7 @@ require_relative "../resource" require_relative "../exceptions" require_relative "../dsl/powershell" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb index dfcb19d147..a5fc40676e 100644 --- a/lib/chef/resource/execute.rb +++ b/lib/chef/resource/execute.rb @@ -18,7 +18,7 @@ # require_relative "../resource" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/gem_package.rb b/lib/chef/resource/gem_package.rb index 8154b61ab3..8832aedd90 100644 --- a/lib/chef/resource/gem_package.rb +++ b/lib/chef/resource/gem_package.rb @@ -17,7 +17,7 @@ # require_relative "package" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/homebrew_package.rb b/lib/chef/resource/homebrew_package.rb index 6113bf54b0..889a87cd81 100644 --- a/lib/chef/resource/homebrew_package.rb +++ b/lib/chef/resource/homebrew_package.rb @@ -19,7 +19,7 @@ require_relative "../provider/package" require_relative "package" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/locale.rb b/lib/chef/resource/locale.rb index f6878ba894..25397f0301 100644 --- a/lib/chef/resource/locale.rb +++ b/lib/chef/resource/locale.rb @@ -16,7 +16,7 @@ # require_relative "../resource" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/notify_group.rb b/lib/chef/resource/notify_group.rb index dc0ab71496..9a1edf3eb8 100644 --- a/lib/chef/resource/notify_group.rb +++ b/lib/chef/resource/notify_group.rb @@ -15,7 +15,6 @@ # require_relative "../resource" -require "chef-utils" class Chef class Resource diff --git a/lib/chef/resource/ohai.rb b/lib/chef/resource/ohai.rb index cfdf636299..303e24d94f 100644 --- a/lib/chef/resource/ohai.rb +++ b/lib/chef/resource/ohai.rb @@ -19,7 +19,7 @@ # require_relative "../resource" -require "chef-utils" +require "chef-utils/dist/infra" require "ohai" unless defined?(Ohai::System) class Chef diff --git a/lib/chef/resource/reboot.rb b/lib/chef/resource/reboot.rb index 93ca2cdd5f..0faaf19462 100644 --- a/lib/chef/resource/reboot.rb +++ b/lib/chef/resource/reboot.rb @@ -17,7 +17,7 @@ # require_relative "../resource" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/rhsm_register.rb b/lib/chef/resource/rhsm_register.rb index c12b96106c..e960e0a0f0 100644 --- a/lib/chef/resource/rhsm_register.rb +++ b/lib/chef/resource/rhsm_register.rb @@ -16,7 +16,7 @@ # require_relative "../resource" -require "chef-utils" +require "chef-utils/dist" require "shellwords" unless defined?(Shellwords) class Chef diff --git a/lib/chef/resource/ruby_block.rb b/lib/chef/resource/ruby_block.rb index 1b738a6507..af98714100 100644 --- a/lib/chef/resource/ruby_block.rb +++ b/lib/chef/resource/ruby_block.rb @@ -19,7 +19,7 @@ require_relative "../resource" require_relative "../provider/ruby_block" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/service.rb b/lib/chef/resource/service.rb index f2e02b2b8d..73a3c05acd 100644 --- a/lib/chef/resource/service.rb +++ b/lib/chef/resource/service.rb @@ -20,7 +20,7 @@ require "chef-utils/dsl/service" unless defined?(ChefUtils::DSL::Service) require_relative "../resource" require "shellwords" unless defined?(Shellwords) -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/ssh_known_hosts_entry.rb b/lib/chef/resource/ssh_known_hosts_entry.rb index f810ac9604..3d812b918b 100644 --- a/lib/chef/resource/ssh_known_hosts_entry.rb +++ b/lib/chef/resource/ssh_known_hosts_entry.rb @@ -18,7 +18,7 @@ # limitations under the License. require_relative "../resource" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/systemd_unit.rb b/lib/chef/resource/systemd_unit.rb index 7ddf71069c..f62f2b17aa 100644 --- a/lib/chef/resource/systemd_unit.rb +++ b/lib/chef/resource/systemd_unit.rb @@ -17,7 +17,7 @@ # require_relative "../resource" -require "chef-utils" +require "chef-utils/dist/infra" require "iniparse" class Chef diff --git a/lib/chef/resource/template.rb b/lib/chef/resource/template.rb index 51f0613a21..b1f6342ec8 100644 --- a/lib/chef/resource/template.rb +++ b/lib/chef/resource/template.rb @@ -20,7 +20,7 @@ require_relative "file" require_relative "../mixin/securable" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/windows_ad_join.rb b/lib/chef/resource/windows_ad_join.rb index 2a8250d012..b86fa57c74 100644 --- a/lib/chef/resource/windows_ad_join.rb +++ b/lib/chef/resource/windows_ad_join.rb @@ -16,7 +16,7 @@ # require_relative "../resource" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/windows_certificate.rb b/lib/chef/resource/windows_certificate.rb index 624ba4e795..5620176321 100644 --- a/lib/chef/resource/windows_certificate.rb +++ b/lib/chef/resource/windows_certificate.rb @@ -23,7 +23,7 @@ module Win32 autoload :Certstore, "win32-certstore" if Chef::Platform.windows? end autoload :OpenSSL, "openssl" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/windows_workgroup.rb b/lib/chef/resource/windows_workgroup.rb index 244f622861..f06dca689b 100644 --- a/lib/chef/resource/windows_workgroup.rb +++ b/lib/chef/resource/windows_workgroup.rb @@ -16,7 +16,7 @@ # require_relative "../resource" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/resource/yum_package.rb b/lib/chef/resource/yum_package.rb index 75c9c5e152..6ded3d5edb 100644 --- a/lib/chef/resource/yum_package.rb +++ b/lib/chef/resource/yum_package.rb @@ -17,7 +17,7 @@ # require_relative "package" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class Resource diff --git a/lib/chef/shell.rb b/lib/chef/shell.rb index 16ebff6f04..b84065e44c 100644 --- a/lib/chef/shell.rb +++ b/lib/chef/shell.rb @@ -24,13 +24,13 @@ require "singleton" unless defined?(Singleton) require "pp" unless defined?(PP) require "etc" unless defined?(Etc) require "mixlib/cli" unless defined?(Mixlib::CLI) +require "chef-utils/dist" require_relative "../chef" require_relative "version" require_relative "client" require_relative "config" require_relative "config_fetcher" -require "chef-utils" require_relative "shell/shell_session" require_relative "workstation_config_loader" diff --git a/lib/chef/shell/ext.rb b/lib/chef/shell/ext.rb index 6175bab492..2cc4d022ae 100644 --- a/lib/chef/shell/ext.rb +++ b/lib/chef/shell/ext.rb @@ -25,7 +25,7 @@ require_relative "shell_session" require_relative "model_wrapper" require_relative "../server_api" require_relative "../json_compat" -require "chef-utils" +require "chef-utils/dist/infra" module Shell module Extensions diff --git a/lib/chef/shell/shell_session.rb b/lib/chef/shell/shell_session.rb index ca3d84cea9..4042f15ee9 100644 --- a/lib/chef/shell/shell_session.rb +++ b/lib/chef/shell/shell_session.rb @@ -28,7 +28,7 @@ require_relative "../run_list/run_list_expansion" require_relative "../formatters/base" require_relative "../formatters/doc" require_relative "../formatters/minimal" -require "chef-utils" +require "chef-utils/dist/infra" module Shell class ShellSession diff --git a/lib/chef/train_transport.rb b/lib/chef/train_transport.rb index ba935f637f..cea51d76c3 100644 --- a/lib/chef/train_transport.rb +++ b/lib/chef/train_transport.rb @@ -17,7 +17,7 @@ require "chef-config/mixin/credentials" autoload :Train, "train" -require "chef-utils" +require "chef-utils/dist/infra" class Chef class TrainTransport diff --git a/spec/functional/event_loggers/windows_eventlog_spec.rb b/spec/functional/event_loggers/windows_eventlog_spec.rb index 0579728b47..b9f10fd4dc 100644 --- a/spec/functional/event_loggers/windows_eventlog_spec.rb +++ b/spec/functional/event_loggers/windows_eventlog_spec.rb @@ -19,6 +19,7 @@ require "spec_helper" require "securerandom" require "chef/event_loggers/windows_eventlog" +require "chef-utils" if ChefUtils.windows? require "win32/eventlog" include Win32 diff --git a/spec/functional/resource/windows_task_spec.rb b/spec/functional/resource/windows_task_spec.rb index 3fe661a550..2347db5af1 100644 --- a/spec/functional/resource/windows_task_spec.rb +++ b/spec/functional/resource/windows_task_spec.rb @@ -18,7 +18,7 @@ require "spec_helper" require "chef/provider/windows_task" -require "chef-utils" +require "chef-utils/dist/infra" describe Chef::Resource::WindowsTask, :windows_only do # resource.task.application_name will default to task_name unless resource.command is set diff --git a/spec/functional/version_spec.rb b/spec/functional/version_spec.rb index 5f4f9f79e0..5d0f0fce43 100644 --- a/spec/functional/version_spec.rb +++ b/spec/functional/version_spec.rb @@ -19,7 +19,7 @@ require "spec_helper" require "chef/mixin/shell_out" require "chef/version" require "ohai/version" -require "chef-utils" +require "chef-utils/dist" describe "Chef Versions", :executables do include Chef::Mixin::ShellOut diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb index b7455c4b80..71f517141e 100644 --- a/spec/integration/client/client_spec.rb +++ b/spec/integration/client/client_spec.rb @@ -3,7 +3,7 @@ require "support/shared/integration/integration_helper" require "chef/mixin/shell_out" require "tiny_server" require "tmpdir" -require "chef-utils" +require "chef-utils/dist" describe "chef-client" do diff --git a/spec/integration/client/exit_code_spec.rb b/spec/integration/client/exit_code_spec.rb index 3b0c7d5a8e..4a69d61a53 100644 --- a/spec/integration/client/exit_code_spec.rb +++ b/spec/integration/client/exit_code_spec.rb @@ -5,6 +5,7 @@ require "chef/mixin/shell_out" require "tiny_server" require "tmpdir" require "chef/platform" +require "chef-utils/dist/infra" describe "chef-client" do diff --git a/spec/integration/solo/solo_spec.rb b/spec/integration/solo/solo_spec.rb index 6c9e2a6f9d..12a49dade6 100644 --- a/spec/integration/solo/solo_spec.rb +++ b/spec/integration/solo/solo_spec.rb @@ -5,8 +5,8 @@ require "chef/run_lock" require "chef/config" require "timeout" require "fileutils" -require "chef/win32/security" if ChefUtils.windows? require "chef-utils" +require "chef/win32/security" if ChefUtils.windows? describe ChefUtils::Dist::Solo::EXEC do include IntegrationSupport diff --git a/spec/unit/cookbook/synchronizer_spec.rb b/spec/unit/cookbook/synchronizer_spec.rb index 22dd211f5b..9a2b1448a7 100644 --- a/spec/unit/cookbook/synchronizer_spec.rb +++ b/spec/unit/cookbook/synchronizer_spec.rb @@ -1,7 +1,7 @@ require "spec_helper" require "chef/cookbook/synchronizer" require "chef/cookbook_version" -require "chef-utils" +require "chef-utils/dist/solo" describe Chef::CookbookCacheCleaner do describe "when cleaning up unused cookbook components" do |