diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | chef.gemspec | 2 | ||||
-rw-r--r-- | lib/chef/knife/serve.rb | 2 | ||||
-rw-r--r-- | lib/chef/local_mode.rb | 14 | ||||
-rw-r--r-- | spec/support/pedant/run_pedant.rb | 1 |
5 files changed, 13 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 40ab884c01..127e0ea60f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Community Contributions +* Updated chef-zero to 3.0. * [**James Belchamber**](https://github.com/JamesBelchamber): Mount provider remount action now honours options * [**Mark Gibbons**](https://github.com/MarkGibbons): diff --git a/chef.gemspec b/chef.gemspec index f8e71a43e1..45917e41fe 100644 --- a/chef.gemspec +++ b/chef.gemspec @@ -29,7 +29,7 @@ Gem::Specification.new do |s| s.add_dependency "erubis", "~> 2.7" s.add_dependency "diff-lcs", "~> 1.2", ">= 1.2.4" - s.add_dependency "chef-zero", "~> 2.2" + s.add_dependency "chef-zero", "3.0" s.add_dependency "pry", "~> 0.9" s.add_dependency 'plist', '~> 3.1.0' diff --git a/lib/chef/knife/serve.rb b/lib/chef/knife/serve.rb index 15994590cd..870177e0be 100644 --- a/lib/chef/knife/serve.rb +++ b/lib/chef/knife/serve.rb @@ -33,7 +33,7 @@ class Chef def run server = Chef::LocalMode.chef_zero_server begin - output "Serving files from:\n#{server.options[:data_store].chef_fs.fs_description}" + output "Serving files from:\n#{Chef::LocalMode.chef_fs.fs_description}" server.stop server.start(stdout) # to print header ensure 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 diff --git a/spec/support/pedant/run_pedant.rb b/spec/support/pedant/run_pedant.rb index 026ae176a6..abee67103c 100644 --- a/spec/support/pedant/run_pedant.rb +++ b/spec/support/pedant/run_pedant.rb @@ -25,7 +25,6 @@ def start_server(chef_repo_path) Chef::Config.versioned_cookbooks = true chef_fs = Chef::ChefFS::Config.new.local_fs data_store = Chef::ChefFS::ChefFSDataStore.new(chef_fs) - data_store = ChefZero::DataStore::V1ToV2Adapter.new(data_store, 'chef', :org_defaults => ChefZero::DataStore::V1ToV2Adapter::ORG_DEFAULTS) server = ChefZero::Server.new(:port => 8889.upto(9999), :data_store => data_store)#, :log_level => :debug) server.start_background server |