diff --git a/lib/kitchen/provisioner/chef_apply.rb b/lib/kitchen/provisioner/chef_apply.rb index 1806d5f3e..42330e700 100644 --- a/lib/kitchen/provisioner/chef_apply.rb +++ b/lib/kitchen/provisioner/chef_apply.rb @@ -57,9 +57,7 @@ class ChefApply < ChefBase plugin_version Kitchen::VERSION default_config :chef_apply_path do |provisioner| - provisioner - .remote_path_join(%W{#{chef_bin_path} chef-apply}) - .tap { |path| path.concat(".bat") if provisioner.windows_os? } + provisioner.remote_path_join(%W{#{chef_bin_path} chef-apply}).tap { |path| path.concat(".bat") if provisioner.windows_os? } end default_config :apply_path do |provisioner| diff --git a/lib/kitchen/provisioner/chef_base.rb b/lib/kitchen/provisioner/chef_base.rb index e87abbdf9..045eebaf0 100644 --- a/lib/kitchen/provisioner/chef_base.rb +++ b/lib/kitchen/provisioner/chef_base.rb @@ -737,8 +737,8 @@ def wrapped_chef_cmd(base_cmd, configfile, append: "") # Determine chef binaries location def chef_bin_path - require_relative '../which' - require_relative '../shell_out' + require_relative "../which" + require_relative "../shell_out" include ShellOut include Which @@ -746,7 +746,7 @@ def chef_bin_path # If no binlinked chef-client binary is found then check for habiatat installed chef-client # If no habitat installed chef-client is found then check for omnibus installed chef-client # all fails raise an error - if which('chef-client') + if which("chef-client") windows_os? ? File.dirname(which("chef-client")) : File.dirname(File.readlink(which("chef-client"))) elsif File.exist?(config[:hab_binary]) && ShellOut.run_command("#{config[:hab_binary]} pkg list chef/chef-infra-client").include?("chef/chef-infra-client") remote_path_join(%W{#{ShellOut.run_command("#{config[:hab_binary]} pkg path chef/chef-infra-client").split("\n").first} bin})