summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2012-12-20 16:54:09 -0800
committerdanielsdeleo <dan@opscode.com>2012-12-21 12:15:18 -0800
commit4638b8e0a0f7edc0a760313cb4acd2db4f11a383 (patch)
treecfb59ab942207d27026c4116a514be870473816c /lib
parent2c460c191bcdb1acfe6978a6e7e7ff8e0273f973 (diff)
downloadchef-4638b8e0a0f7edc0a760313cb4acd2db4f11a383.tar.gz
[CHEF-3715] rm moneta's config options
Cache for syntax check is configured by syntax_check_cache_path. For compatibility, the old moneta-specific cache_options[:path] will be used when syntax_check_cache_path is not set (defaults to nil)
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/config.rb16
-rw-r--r--lib/chef/cookbook/syntax_check.rb8
-rw-r--r--lib/chef/knife/configure.rb3
3 files changed, 18 insertions, 9 deletions
diff --git a/lib/chef/config.rb b/lib/chef/config.rb
index 74b10a4250..d05692ddc8 100644
--- a/lib/chef/config.rb
+++ b/lib/chef/config.rb
@@ -48,9 +48,6 @@ class Chef
end
def self.platform_specific_path(path)
- #10.times { puts "* " * 40}
- #pp caller
-
if RUBY_PLATFORM =~ /mswin|mingw|windows/
# turns /etc/chef/client.rb into C:/chef/client.rb
system_drive = ENV['SYSTEMDRIVE'] ? ENV['SYSTEMDRIVE'] : ""
@@ -309,7 +306,18 @@ class Chef
# Start handlers
start_handlers []
- # Checksum Cache
+ # Syntax Check Cache. Knife keeps track of files that is has already syntax
+ # checked by storing files in this directory. `syntax_check_cache_path` is
+ # the new (and preferred) configuration setting. If not set, knife will
+ # fall back to using cache_options[:path].
+ #
+ # Because many users will have knife configs with cache_options (generated
+ # by `knife configure`), the default for now is to *not* set
+ # syntax_check_cache_path, and thus fallback to cache_options[:path]. We
+ # leave that value to the same default as was previously set.
+ syntax_check_cache_path nil
+
+ # Deprecated:
cache_options({ :path => platform_specific_path("/var/chef/cache/checksums") })
# Set to false to silence Chef 11 deprecation warnings:
diff --git a/lib/chef/cookbook/syntax_check.rb b/lib/chef/cookbook/syntax_check.rb
index 2ba62e568e..d656f96ebd 100644
--- a/lib/chef/cookbook/syntax_check.rb
+++ b/lib/chef/cookbook/syntax_check.rb
@@ -39,9 +39,11 @@ class Chef
# Create a new PersistentSet. Values in the set are persisted by
# creating a file in the +cache_path+ directory. If not given, the
- # value of Chef::Config[:cache_options][:path] is used.
- def initialize(cache_path=Chef::Config[:cache_options][:path])
- @cache_path = cache_path
+ # value of Chef::Config[:syntax_check_cache_path] is used; if that
+ # value is not configured, the value of
+ # Chef::Config[:cache_options][:path] is used.
+ def initialize(cache_path=nil)
+ @cache_path = cache_path || Chef::Config[:syntax_check_cache_path] || Chef::Config[:cache_options][:path]
@cache_path_created = false
end
diff --git a/lib/chef/knife/configure.rb b/lib/chef/knife/configure.rb
index 0be7093e29..e818239a89 100644
--- a/lib/chef/knife/configure.rb
+++ b/lib/chef/knife/configure.rb
@@ -81,8 +81,7 @@ client_key '#{new_client_key}'
validation_client_name '#{validation_client_name}'
validation_key '#{validation_key}'
chef_server_url '#{chef_server}'
-cache_type 'BasicFile'
-cache_options( :path => '#{File.join(chef_config_path, "checksums")}' )
+syntax_check_cache_path '#{File.join(chef_config_path, "syntax_check_cache")}'
EOH
unless chef_repo.empty?
f.puts "cookbook_path [ '#{chef_repo}/cookbooks' ]"