Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chef::Config[:cache_path] should default to C:\chef on windows #9094

Open
lamont-granquist opened this issue Nov 14, 2019 · 0 comments
Open

Chef::Config[:cache_path] should default to C:\chef on windows #9094

lamont-granquist opened this issue Nov 14, 2019 · 0 comments

Comments

@lamont-granquist
Copy link
Contributor

@lamont-granquist lamont-granquist commented Nov 14, 2019

I don't think it currently does?

# The root of all caches (checksums, cache and backup). If local mode is on,
# this is under the user's home directory.
default(:cache_path) do
if local_mode
PathHelper.join(config_dir, "local-mode-cache")
else
primary_cache_root = platform_specific_path("/var")
primary_cache_path = platform_specific_path("/var/chef")
# Use /var/chef as the cache path only if that folder exists and we can read and write
# into it, or /var exists and we can read and write into it (we'll create /var/chef later).
# Otherwise, we'll create .chef under the user's home directory and use that as
# the cache path.
unless path_accessible?(primary_cache_path) || path_accessible?(primary_cache_root)
secondary_cache_path = PathHelper.join(user_home, ".chef")
secondary_cache_path = target_mode? ? "#{secondary_cache_path}/#{target_mode.host}" : secondary_cache_path
ChefConfig.logger.trace("Unable to access cache at #{primary_cache_path}. Switching cache to #{secondary_cache_path}")
secondary_cache_path
else
target_mode? ? "#{primary_cache_path}/#{target_mode.host}" : primary_cache_path
end
end
end

Most windows users must be getting this setting from the chef-client cookbook?

https://github.com/chef-cookbooks/chef-client/blob/517e866e6aa2154663087e33a14cceddeec5e287/attributes/default.rb#L163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.