diff options
Diffstat (limited to 'lib/chef/local_mode.rb')
-rw-r--r-- | lib/chef/local_mode.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/chef/local_mode.rb b/lib/chef/local_mode.rb index ad1968a6a6..e66acb6b66 100644 --- a/lib/chef/local_mode.rb +++ b/lib/chef/local_mode.rb @@ -52,9 +52,10 @@ class Chef require 'chef/chef_fs/chef_fs_data_store' require 'chef/chef_fs/config' - chef_fs = Chef::ChefFS::Config.new.local_fs - chef_fs.write_pretty_json = true - data_store = Chef::ChefFS::ChefFSDataStore.new(chef_fs) + @chef_fs = Chef::ChefFS::Config.new.local_fs + @chef_fs.write_pretty_json = true + data_store = Chef::ChefFS::ChefFSDataStore.new(@chef_fs) + data_store = ChefZero::DataStore::V1ToV2Adapter.new(data_store, 'chef') server_options = {} server_options[:data_store] = data_store server_options[:log_level] = Chef::Log.level @@ -62,7 +63,7 @@ class Chef server_options[:port] = parse_port(Chef::Config.chef_zero.port) @chef_zero_server = ChefZero::Server.new(server_options) @chef_zero_server.start_background - Chef::Log.info("Started chef-zero at #{@chef_zero_server.url} with #{chef_fs.fs_description}") + Chef::Log.info("Started chef-zero at #{@chef_zero_server.url} with #{@chef_fs.fs_description}") Chef::Config.chef_server_url = @chef_zero_server.url end end @@ -72,6 +73,11 @@ class Chef @chef_zero_server end + # Return the chef_fs object for the current chef-zero server. + def self.chef_fs + @chef_fs + end + # If chef_zero_server is non-nil, stop it and remove references to it. def self.destroy_server_connectivity if @chef_zero_server |