summaryrefslogtreecommitdiff
path: root/lib/chef/cookbook/synchronizer.rb
diff options
context:
space:
mode:
authorBryan McLellan <btm@opscode.com>2013-01-24 20:18:26 -0800
committerBryan McLellan <btm@opscode.com>2013-06-18 13:46:04 -0700
commit4ee5dc9c95e75ec835c6e6d35298ef67c445b579 (patch)
treeff487eec66b259742ad8fd8d61fb83db7f6a85d5 /lib/chef/cookbook/synchronizer.rb
parentfebf9c2be9a35ac5f756c207f4dad9853839951a (diff)
downloadchef-4ee5dc9c95e75ec835c6e6d35298ef67c445b579.tar.gz
CHEF-3045: Re-provide lost support for no_lazy_load
Originally added in 1938b77, but the move of the cookbook sync code in f880869c93 got messed up in bad merge b36f636 Also, add something test-like.
Diffstat (limited to 'lib/chef/cookbook/synchronizer.rb')
-rw-r--r--lib/chef/cookbook/synchronizer.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/chef/cookbook/synchronizer.rb b/lib/chef/cookbook/synchronizer.rb
index 54cadb941c..4522323fac 100644
--- a/lib/chef/cookbook/synchronizer.rb
+++ b/lib/chef/cookbook/synchronizer.rb
@@ -56,12 +56,14 @@ class Chef
# Synchronizes the locally cached copies of cookbooks with the files on the
# server.
class CookbookSynchronizer
- EAGER_SEGMENTS = Chef::CookbookVersion::COOKBOOK_SEGMENTS.dup
- EAGER_SEGMENTS.delete(:files)
- EAGER_SEGMENTS.delete(:templates)
- EAGER_SEGMENTS.freeze
-
def initialize(cookbooks_by_name, events)
+ @eager_segments = Chef::CookbookVersion::COOKBOOK_SEGMENTS.dup
+ unless Chef::Config[:no_lazy_load]
+ @eager_segments.delete(:files)
+ @eager_segments.delete(:templates)
+ end
+ @eager_segments.freeze
+
@cookbooks_by_name, @events = cookbooks_by_name, events
end
@@ -138,7 +140,7 @@ class Chef
# files and templates are lazily loaded, and will be done later.
- EAGER_SEGMENTS.each do |segment|
+ @eager_segments.each do |segment|
segment_filenames = Array.new
cookbook.manifest[segment].each do |manifest_record|