diff options
Diffstat (limited to 'lib/chef/chef_fs/chef_fs_data_store.rb')
-rw-r--r-- | lib/chef/chef_fs/chef_fs_data_store.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/chef_fs/chef_fs_data_store.rb b/lib/chef/chef_fs/chef_fs_data_store.rb index f174c32acf..6ccf12bd56 100644 --- a/lib/chef/chef_fs/chef_fs_data_store.rb +++ b/lib/chef/chef_fs/chef_fs_data_store.rb @@ -203,12 +203,16 @@ class Chef elsif path[0] == 'cookbooks' && path.length == 2 if Chef::Config.versioned_cookbooks - with_entry([ 'cookbooks' ]) do |entry| + result = with_entry([ 'cookbooks' ]) do |entry| # list /cookbooks/name = filter /cookbooks/name-version down to name entry.children.map { |child| split_name_version(child.name) }. select { |name, version| name == path[1] }. map { |name, version| version } end + if result == [] + raise ChefZero::DataStore::DataNotFoundError.new(path) + end + result else # list /cookbooks/name = <single version> version = get_single_cookbook_version(path) |