From 8a019bf992dd1f483db2d1cf82612ba262fbfaa2 Mon Sep 17 00:00:00 2001 From: Daniel DeLeo Date: Thu, 7 Apr 2011 23:36:20 -0700 Subject: [CHEF-2198] Fix incorrect checksum errors on upload --- chef/lib/chef/knife/cookbook_upload.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chef/lib/chef/knife/cookbook_upload.rb b/chef/lib/chef/knife/cookbook_upload.rb index e7e8e1dcc0..bafe3cc2c8 100644 --- a/chef/lib/chef/knife/cookbook_upload.rb +++ b/chef/lib/chef/knife/cookbook_upload.rb @@ -150,7 +150,10 @@ class Chef # if only you people wouldn't put broken symlinks in your cookbooks in # the first place. ;) def check_for_broken_links(cookbook) - broken_files = cookbook.manifest_records_by_path.select do |path, info| + # MUST!! dup the cookbook version object--it memoizes its + # manifest object, but the manifest becomes invalid when you + # regenerate the metadata + broken_files = cookbook.dup.manifest_records_by_path.select do |path, info| info[CHECKSUM].nil? || info[CHECKSUM] !~ MATCH_CHECKSUM end unless broken_files.empty? -- cgit v1.2.1