diff options
author | John Keiser <jkeiser@opscode.com> | 2014-07-16 07:31:34 -0700 |
---|---|---|
committer | John Keiser <jkeiser@opscode.com> | 2014-07-23 19:21:23 -0600 |
commit | e811e7aa8ffce23430453aa389da5c38f4ee087d (patch) | |
tree | ace417786593e4517651a0d9cc02a949b75cfc8d /lib/chef_zero/server.rb | |
parent | 856e52dd7abfd78259721528254a5b30e13d9cd3 (diff) | |
download | chef-zero-e811e7aa8ffce23430453aa389da5c38f4ee087d.tar.gz |
Move org defaults to a common class, DefaultFacade
for readability and so that memory and disk stores can share the defaults
and so that they can be switched out at will
Diffstat (limited to 'lib/chef_zero/server.rb')
-rw-r--r-- | lib/chef_zero/server.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef_zero/server.rb b/lib/chef_zero/server.rb index e352e98..ec93d8a 100644 --- a/lib/chef_zero/server.rb +++ b/lib/chef_zero/server.rb @@ -30,6 +30,7 @@ require 'chef_zero/cookbook_data' require 'chef_zero/rest_router' require 'chef_zero/data_store/memory_store_v2' require 'chef_zero/data_store/v1_to_v2_adapter' +require 'chef_zero/data_store/default_facade' require 'chef_zero/version' require 'chef_zero/endpoints/rest_list_endpoint' @@ -125,12 +126,13 @@ module ChefZero # def data_store @data_store ||= begin - result = @options[:data_store] || DataStore::MemoryStoreV2.new + result = @options[:data_store] || DataStore::DefaultFacade.new(DataStore::MemoryStoreV2.new) if options[:single_org] if result.respond_to?(:interface_version) && result.interface_version >= 2 && result.interface_version < 3 result.create_dir([ 'organizations' ], options[:single_org]) else result = ChefZero::DataStore::V1ToV2Adapter.new(result, options[:single_org]) + result = ChefZero::DataStore::DefaultFacade.new(result) end else if !(result.respond_to?(:interface_version) && result.interface_version >= 2 && result.interface_version < 3) |