summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsnehaldwivedi <sdwivedi@msystechnologies.com>2021-03-16 08:59:41 +0000
committerBryan McLellan <btm@loftninjas.org>2021-05-05 15:02:38 -0400
commit58386cc19fca35f98faf63617f1061ba35c71763 (patch)
tree62925daac05178d83fe407b41d842b520f7c8cea
parent185fbabe13035fc94cd2e696e65ce00591bedffb (diff)
downloadchef-snehal/Users_created_on_nodes_after_knife_bootstrap.tar.gz
ZD 25979 - /Users created on nodes after knife bootstrapsnehal/Users_created_on_nodes_after_knife_bootstrap
Signed-off-by: snehaldwivedi <sdwivedi@msystechnologies.com>
-rw-r--r--knife/lib/chef/knife/core/bootstrap_context.rb4
-rw-r--r--knife/spec/unit/knife/core/bootstrap_context_spec.rb8
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