From 58386cc19fca35f98faf63617f1061ba35c71763 Mon Sep 17 00:00:00 2001 From: snehaldwivedi Date: Tue, 16 Mar 2021 08:59:41 +0000 Subject: ZD 25979 - /Users created on nodes after knife bootstrap Signed-off-by: snehaldwivedi --- knife/lib/chef/knife/core/bootstrap_context.rb | 4 ++-- knife/spec/unit/knife/core/bootstrap_context_spec.rb | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/knife/lib/chef/knife/core/bootstrap_context.rb b/knife/lib/chef/knife/core/bootstrap_context.rb index 0d71aa8dc3..37ddc28409 100644 --- a/knife/lib/chef/knife/core/bootstrap_context.rb +++ b/knife/lib/chef/knife/core/bootstrap_context.rb @@ -172,11 +172,11 @@ class Chef end unless chef_config[:file_cache_path].nil? - client_rb << "file_cache_path \"#{chef_config[:file_cache_path]}\"\n" + client_rb << "file_cache_path \"#{ChefConfig::PathHelper.escapepath(ChefConfig::Config.var_chef_dir(windows: false))}/cache\"\n" end unless chef_config[:file_backup_path].nil? - client_rb << "file_backup_path \"#{chef_config[:file_backup_path]}\"\n" + client_rb << "file_backup_path \"#{ChefConfig::PathHelper.escapepath(ChefConfig::Config.var_chef_dir(windows: false))}/backup\"\n" end client_rb diff --git a/knife/spec/unit/knife/core/bootstrap_context_spec.rb b/knife/spec/unit/knife/core/bootstrap_context_spec.rb index 79fddc8184..8a3637aafb 100644 --- a/knife/spec/unit/knife/core/bootstrap_context_spec.rb +++ b/knife/spec/unit/knife/core/bootstrap_context_spec.rb @@ -81,16 +81,16 @@ describe Chef::Knife::Core::BootstrapContext do end describe "when file_cache_path is set" do - let(:chef_config) { { file_cache_path: "/home/opscode/cache" } } + let(:chef_config) { { file_cache_path: "/var/chef/cache" } } it "sets file_cache_path in the generated config file" do - expect(bootstrap_context.config_content).to include("file_cache_path \"/home/opscode/cache\"") + expect(bootstrap_context.config_content).to include("file_cache_path \"/var/chef/cache\"") end end describe "when file_backup_path is set" do - let(:chef_config) { { file_backup_path: "/home/opscode/backup" } } + let(:chef_config) { { file_backup_path: "/var/chef/backup" } } it "sets file_backup_path in the generated config file" do - expect(bootstrap_context.config_content).to include("file_backup_path \"/home/opscode/backup\"") + expect(bootstrap_context.config_content).to include("file_backup_path \"/var/chef/backup\"") end end -- cgit v1.2.1