diff options
author | Daniel DeLeo <dan@opscode.com> | 2010-05-27 13:00:08 -0700 |
---|---|---|
committer | Daniel DeLeo <dan@opscode.com> | 2010-06-03 12:22:11 -0700 |
commit | c63d4bad1b92630ebc6087714b211b7ffd548e6a (patch) | |
tree | 75734f2344685e84edf1072d8fb67c3649041135 | |
parent | c453db96d8c470b6b0e739b32aa01727c2f787f6 (diff) | |
download | chef-c63d4bad1b92630ebc6087714b211b7ffd548e6a.tar.gz |
fix solr startup and features knife config
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | chef-solr/lib/chef/solr/application/solr.rb | 4 | ||||
-rw-r--r-- | chef/lib/chef/client.rb | 2 | ||||
-rw-r--r-- | features/data/config/knife.rb | 11 | ||||
-rw-r--r-- | features/support/env.rb | 11 |
5 files changed, 27 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore index 5d7ba78c01..b87bf5d512 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,5 @@ features/data/cookbooks/**/metadata.json features/data/solr/** erl_crash.dump *.rake_tasks~ -.idea
\ No newline at end of file +.idea +features/data/repo/checksums/ diff --git a/chef-solr/lib/chef/solr/application/solr.rb b/chef-solr/lib/chef/solr/application/solr.rb index 89cd3b3599..01df42b551 100644 --- a/chef-solr/lib/chef/solr/application/solr.rb +++ b/chef-solr/lib/chef/solr/application/solr.rb @@ -117,6 +117,7 @@ class Chef end def setup_application + STDERR.puts "wot the fuck cunt" # Need to redirect stdout and stderr so Java process inherits them. # If -L wasn't specified, Chef::Config[:log_location] will be an IO # object, otherwise it will be a String. @@ -126,7 +127,8 @@ class Chef @logfile = File.new(Chef::Config[:log_location], "a") end - Chef::Log.level = Chef::Config[:log_level] + #Chef::Log.level = Chef::Config[:log_level] + Chef::Log.level = :debug # Build up a client node = Chef::Node.new diff --git a/chef/lib/chef/client.rb b/chef/lib/chef/client.rb index 4223b7bb50..fe7ca74ad6 100644 --- a/chef/lib/chef/client.rb +++ b/chef/lib/chef/client.rb @@ -29,6 +29,8 @@ require 'chef/file_cache' require 'chef/run_context' require 'chef/runner' require 'chef/cookbook/cookbook_collection' +require 'chef/cookbook/file_vendor' +require 'chef/cookbook/file_system_file_vendor' require 'ohai' class Chef diff --git a/features/data/config/knife.rb b/features/data/config/knife.rb new file mode 100644 index 0000000000..7dec7a3f3c --- /dev/null +++ b/features/data/config/knife.rb @@ -0,0 +1,11 @@ +log_level :debug +log_location STDOUT +# Webui is an admin. +# env.rb gets the client name from Chef::Config[:web_ui_client_name] but we +# cannot use that since it won't be loaded in knife's memory. +node_name 'chef-webui' +client_key "#{Dir.tmpdir}/webui.pem" +validation_client_name 'chef-validator' +validation_key "#{Dir.tmpdir}/validation.pem" +chef_server_url 'http://localhost:4000' +cache_type 'BasicFile' diff --git a/features/support/env.rb b/features/support/env.rb index e0e50c6bc3..b97b1f20eb 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -20,6 +20,10 @@ require 'rubygems' require 'spec/expectations' CHEF_PROJECT_ROOT = File.expand_path(File.dirname(__FILE__) + '/../../') +KNIFE_CONFIG = CHEF_PROJECT_ROOT + '/features/data/config/knife.rb' +KNIFE_CMD = File.expand_path(File.join(CHEF_PROJECT_ROOT, "chef", "bin", "knife")) +INTEGRATION_COOKBOOKS = File.join(CHEF_PROJECT_ROOT, "features", "data", "cookbooks") + $:.unshift(CHEF_PROJECT_ROOT + '/chef/lib') $:.unshift(CHEF_PROJECT_ROOT + '/chef-server-api/lib') $:.unshift(CHEF_PROJECT_ROOT + '/chef-server-webui/lib') @@ -35,10 +39,13 @@ require 'chef/checksum' require 'chef/sandbox' require 'chef/solr' require 'chef/certificate' +require 'chef/mixin/shell_out' require 'tmpdir' require 'chef/streaming_cookbook_uploader' require 'webrick' +include Chef::Mixin::ShellOut + ENV['LOG_LEVEL'] ||= 'error' def setup_logging @@ -83,9 +90,9 @@ def create_databases system("cp #{File.join(Dir.tmpdir, "chef_integration", "validation.pem")} #{Dir.tmpdir}") system("cp #{File.join(Dir.tmpdir, "chef_integration", "webui.pem")} #{Dir.tmpdir}") - cmd = [File.join(File.dirname(__FILE__), "..", "..", "chef", "bin", "knife"), "cookbook", "upload", "-a", "-o", File.join(File.dirname(__FILE__), "..", "data", "cookbooks"), "-u", "validator", "-k", File.join(Dir.tmpdir, "validation.pem")] + cmd = [KNIFE_CMD, "cookbook", "upload", "-a", "-o", INTEGRATION_COOKBOOKS, "-u", "validator", "-k", File.join(Dir.tmpdir, "validation.pem"), "-c", KNIFE_CONFIG] Chef::Log.info("Uploading fixture cookbooks with #{cmd.join(' ')}") - system(*cmd) + shell_out!(*cmd) end def prepare_replicas |