summaryrefslogtreecommitdiff
path: root/lib/chef/local_mode.rb
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2014-08-22 09:22:44 -0700
committerJohn Keiser <jkeiser@opscode.com>2014-08-22 15:24:44 -0700
commit8620abd3ea4bb3a717d24a5da2954d4843f4dcac (patch)
treebe246bc753d5f512992b76ecfd4ec2a388adbf9d /lib/chef/local_mode.rb
parente75794301ba4ef3a7843e90a93271946bdb0ea1a (diff)
downloadchef-8620abd3ea4bb3a717d24a5da2954d4843f4dcac.tar.gz
Update to chef-zero 3
Diffstat (limited to 'lib/chef/local_mode.rb')
-rw-r--r--lib/chef/local_mode.rb14
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