diff options
author | danielsdeleo <dan@getchef.com> | 2015-03-27 12:07:57 -0700 |
---|---|---|
committer | danielsdeleo <dan@getchef.com> | 2015-04-01 13:35:01 -0700 |
commit | 110f3b77d46d4c58c00e1badeaec92875fb4e1ef (patch) | |
tree | 4f7bafa46fb9c7125bcead02faa96e849d72c38c /lib/chef/local_mode.rb | |
parent | 6813675a20f232afbe440800a56d4385be55e9fe (diff) | |
download | chef-110f3b77d46d4c58c00e1badeaec92875fb4e1ef.tar.gz |
Initial socketless local mode
Diffstat (limited to 'lib/chef/local_mode.rb')
-rw-r--r-- | lib/chef/local_mode.rb | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/chef/local_mode.rb b/lib/chef/local_mode.rb index e66acb6b66..c814301b4b 100644 --- a/lib/chef/local_mode.rb +++ b/lib/chef/local_mode.rb @@ -18,6 +18,9 @@ require 'chef/config' class Chef module LocalMode + + LOCAL_MODE_URL = "chefzero://localhost" + # Create a chef local server (if the configuration requires one) for the # duration of the given block. # @@ -59,12 +62,15 @@ class Chef server_options = {} server_options[:data_store] = data_store server_options[:log_level] = Chef::Log.level - server_options[:host] = Chef::Config.chef_zero.host - 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::Config.chef_server_url = @chef_zero_server.url + # server_options[:host] = Chef::Config.chef_zero.host + # server_options[:port] = parse_port(Chef::Config.chef_zero.port) + # @chef_zero_server = ChefZero::Server.new(server_options) + # @chef_zero_server.start_background + + ChefZero::Socketless.instance.reset!(server_options) + + Chef::Log.info("Started chef-zero at #{LOCAL_MODE_URL} with #{@chef_fs.fs_description}") + Chef::Config.chef_server_url = LOCAL_MODE_URL end end @@ -80,10 +86,11 @@ class Chef # If chef_zero_server is non-nil, stop it and remove references to it. def self.destroy_server_connectivity - if @chef_zero_server - @chef_zero_server.stop - @chef_zero_server = nil - end + return nil + # if @chef_zero_server + # @chef_zero_server.stop + # @chef_zero_server = nil + # end end def self.parse_port(port) |