lib/chef/cookbook_version.rb in chef-0.9.0.a91 vs lib/chef/cookbook_version.rb in chef-0.9.0.a92

- old
+ new

@@ -32,11 +32,10 @@ attr_accessor :definition_filenames, :template_filenames, :file_filenames, :library_filenames, :resource_filenames, :provider_filenames, :root_filenames, :name, :metadata, :metadata_filenames, :status, :couchdb_rev, :couchdb attr_reader :couchdb_id - attr_reader :file_vendor # attribute_filenames also has a setter that has non-default # functionality. attr_reader :attribute_filenames @@ -378,11 +377,10 @@ else file_vendor.get_filename(manifest_record['path']) end end - def relative_filenames_in_preferred_directory(node, segment, dirname) preferences = preferences_for_path(node, segment, dirname) filenames_by_pref = Hash.new preferences.each { |pref| filenames_by_pref[pref] = Array.new } @@ -800,12 +798,18 @@ manifest[:metadata] = metadata manifest[:version] = metadata.version manifest[:name] = full_name @checksums = checksums_to_on_disk_paths - @file_vendor = Chef::Cookbook::FileVendor.create_from_manifest(manifest) @manifest = manifest @manifest_records_by_path = extract_manifest_records_by_path(manifest) + end + + def file_vendor + unless @file_vendor + @file_vendor = Chef::Cookbook::FileVendor.create_from_manifest(manifest) + end + @file_vendor end def extract_checksums_from_manifest(manifest) checksums = {} COOKBOOK_SEGMENTS.each do |segment|