# File lib/chef/data_bag.rb, line 159 def self.load(name) if Chef::Config[:solo] unless File.directory?(Chef::Config[:data_bag_path]) raise Chef::Exceptions::InvalidDataBagPath, "Data bag path '#{Chef::Config[:data_bag_path]}' is invalid" end Dir.glob(File.join(Chef::Config[:data_bag_path], name, "*.json")).inject({}) do |bag, f| item = JSON.parse(IO.read(f)) bag[item['id']] = item bag end else Chef::REST.new(Chef::Config[:chef_server_url]).get_rest("data/#{name}") end end