summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authordanielsdeleo <dan@chef.io>2016-01-27 12:37:30 -0800
committerdanielsdeleo <dan@chef.io>2016-01-27 19:43:58 -0800
commitc79c3cb5a80c5260452e585e58bf71597a028774 (patch)
tree0be02daac9b3db8c6c09d6aacd94756b0fab94f9 /lib/chef
parentf0a0b3cdd1674dbf138e71fd1fb64939bad057df (diff)
downloadchef-c79c3cb5a80c5260452e585e58bf71597a028774.tar.gz
Remove incorrect cookbook artifact normalizationfix-cookbook-artifact-normalization
Pedant tests were leading us astray, we don't want to remove entries for empty cookbook segments
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/chef_fs/chef_fs_data_store.rb6
-rw-r--r--lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_artifact_dir.rb2
2 files changed, 1 insertions, 7 deletions
diff --git a/lib/chef/chef_fs/chef_fs_data_store.rb b/lib/chef/chef_fs/chef_fs_data_store.rb
index 59c2699cca..729b01fdcc 100644
--- a/lib/chef/chef_fs/chef_fs_data_store.rb
+++ b/lib/chef/chef_fs/chef_fs_data_store.rb
@@ -333,13 +333,7 @@ class Chef
end
end
- # Cookbook artifacts act as if certain things aren't set if they are empty
- # (e.g. "definitions" and "libraries" are not set if they are empty, but
- # "recipes" is)
if cookbook_type == "cookbook_artifacts"
- result.delete_if do |key,value|
- (value == [] && key != "recipes")
- end
result["metadata"] = result["metadata"].to_hash
result["metadata"].delete_if do |key,value|
value == [] ||
diff --git a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_artifact_dir.rb b/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_artifact_dir.rb
index dbff973f17..0aab6382be 100644
--- a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_artifact_dir.rb
+++ b/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_artifact_dir.rb
@@ -26,7 +26,7 @@ class Chef
# Override from parent
def cookbook_version
loader = Chef::Cookbook::CookbookVersionLoader.new(file_path, parent.chefignore)
- cookbook_name, dash, identifier = name.rpartition("-")
+ cookbook_name, _dash, identifier = name.rpartition("-")
# KLUDGE: We shouldn't have to use instance_variable_set
loader.instance_variable_set(:@cookbook_name, cookbook_name)
loader.load_cookbooks