summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-10-30 19:57:12 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-10-30 19:57:12 -0700
commita114046532e8c9576ec185b9fba071a28bab0b3d (patch)
tree37cd9872cfb17063d926382eadfeca56b3e223ae /lib
parent9e399e297aec16f46e40b3cb361ed625067642b5 (diff)
downloadchef-a114046532e8c9576ec185b9fba071a28bab0b3d.tar.gz
more removal of cookbook shadowing/merginglcg/chef-15-cleanup-cookbook-loader
we no longer support reading cookbooks from multiple cookbook paths. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/cookbook/cookbook_version_loader.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/chef/cookbook/cookbook_version_loader.rb b/lib/chef/cookbook/cookbook_version_loader.rb
index ea0b9d2b08..96bc4aa303 100644
--- a/lib/chef/cookbook/cookbook_version_loader.rb
+++ b/lib/chef/cookbook/cookbook_version_loader.rb
@@ -22,7 +22,6 @@ class Chef
UPLOADED_COOKBOOK_VERSION_FILE = ".uploaded-cookbook-version.json".freeze
attr_reader :cookbook_settings
- attr_reader :cookbook_paths
attr_reader :frozen
attr_reader :uploaded_cookbook_version_file
@@ -35,8 +34,6 @@ class Chef
def initialize(path, chefignore = nil)
@cookbook_path = File.expand_path( path ) # cookbook_path from which this was loaded
- # We keep a list of all cookbook paths that have been merged in
- @cookbook_paths = [ cookbook_path ]
@inferred_cookbook_name = File.basename( path )
@chefignore = chefignore
@@ -86,7 +83,7 @@ class Chef
def cookbook_version
return nil if empty?
- Chef::CookbookVersion.new(cookbook_name, *cookbook_paths).tap do |c|
+ Chef::CookbookVersion.new(cookbook_name, cookbook_path).tap do |c|
c.all_files = cookbook_settings[:all_files].values
c.metadata = metadata
@@ -164,7 +161,7 @@ class Chef
# actually empty, a metadata error here would be misleading, so don't
# raise it (if called by #load!, a different error is raised).
if !empty? && !metadata.valid?
- message = "Cookbook loaded at path(s) [#{cookbook_paths.join(', ')}] has invalid metadata: #{metadata.errors.join('; ')}"
+ message = "Cookbook loaded at path [#{cookbook_path}] has invalid metadata: #{metadata.errors.join('; ')}"
raise Exceptions::MetadataNotValid, message
end
false