summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2013-10-14 07:48:05 -0700
committerJohn Keiser <jkeiser@opscode.com>2013-10-14 07:52:15 -0700
commit294f9770d993b3ad6d504470a5ab1a9cbac59231 (patch)
treef3f53ebbbf0dd0a76dd5207d93c8531833fa166c /lib
parent684c0837760d7963c8d77ceea44af497ef8e9c0c (diff)
downloadchef-294f9770d993b3ad6d504470a5ab1a9cbac59231.tar.gz
Remove old :local option from knife-essentials commands
(superceded by global -z option)
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/chef_fs/knife.rb56
1 files changed, 0 insertions, 56 deletions
diff --git a/lib/chef/chef_fs/knife.rb b/lib/chef/chef_fs/knife.rb
index 31df6470e8..652c728550 100644
--- a/lib/chef/chef_fs/knife.rb
+++ b/lib/chef/chef_fs/knife.rb
@@ -71,13 +71,6 @@ class Chef
@chef_fs_config = Chef::ChefFS::Config.new(Chef::Config, Dir.pwd, config)
Chef::ChefFS::Parallelizer.threads = (Chef::Config[:concurrency] || 10) - 1
-
- if Chef::Config[:chef_server_url].to_sym == :local
- local_url = start_local_server
- Chef::Config[:chef_server_url] = local_url
- Chef::Config[:client_key] = nil
- Chef::Config[:validation_key] = nil
- end
end
def chef_fs
@@ -123,33 +116,6 @@ class Chef
Chef::ChefFS::Parallelizer.parallelize(inputs, options, &block)
end
- def locate_config_file
- super
- if !config[:config_file]
- # If the config file doesn't already exist, find out where it should be,
- # and create it.
- repo_dir = discover_repo_dir(Dir.pwd)
- if repo_dir
- dot_chef = File.join(repo_dir, ".chef")
- if !File.directory?(dot_chef)
- Dir.mkdir(dot_chef)
- end
- knife_rb = File.join(dot_chef, "knife.rb")
- if !File.exist?(knife_rb)
- ui.warn("No configuration found. Creating .chef/knife.rb in #{repo_dir} ...")
- File.open(knife_rb, "w") do |file|
- file.write <<EOM
- chef_server_url 'local'
- chef_repo_path File.dirname(File.dirname(__FILE__))
- cookbook_path File.join(chef_repo_path, "cookbooks")
-EOM
- end
- end
- config[:config_file] = knife_rb
- end
- end
- end
-
def discover_repo_dir(dir)
%w(.chef cookbooks data_bags environments roles).each do |subdir|
return dir if File.directory?(File.join(dir, subdir))
@@ -162,28 +128,6 @@ EOM
nil
end
end
-
- def start_local_server
- begin
- require 'chef_zero/server'
- rescue LoadError
- STDERR.puts <<EOM
- ERROR: chef-zero must be installed to use local-server mode! To install:
-
- gem install chef-zero
-
-EOM
- exit(1)
- end
- require 'chef/chef_fs/chef_fs_data_store'
- server_options = {}
- server_options[:data_store] = ChefFSChefFSDataStore.new(local_fs)
- server_options[:log_level] = Chef::Log.level
- server_options[:port] = 8889
- server = ChefZero::Server.new(server_options)
- server.start_background
- server.url
- end
end
end
end