summaryrefslogtreecommitdiff
path: root/features/steps
diff options
context:
space:
mode:
authorDaniel DeLeo <dan@opscode.com>2011-03-28 15:07:08 -0700
committerDaniel DeLeo <dan@opscode.com>2011-03-28 15:08:19 -0700
commitca54deb184f79aa61c80845d22bd5c22d199c7ac (patch)
tree5e54a5ad69589d0542fef6064f8b793cb12c0e59 /features/steps
parent78ca2b882ec2895275b318ed642df5602c072cbe (diff)
downloadchef-ca54deb184f79aa61c80845d22bd5c22d199c7ac.tar.gz
fixes for features
Diffstat (limited to 'features/steps')
-rw-r--r--features/steps/cookbook_steps.rb17
-rw-r--r--features/steps/node_steps.rb2
-rw-r--r--features/steps/run_solo.rb6
3 files changed, 12 insertions, 13 deletions
diff --git a/features/steps/cookbook_steps.rb b/features/steps/cookbook_steps.rb
index 3e4e78f9c0..ac629e7b45 100644
--- a/features/steps/cookbook_steps.rb
+++ b/features/steps/cookbook_steps.rb
@@ -110,16 +110,15 @@ end
When "I upload a cookbook named '$name' at version '$version'" do |name, version|
- # This is total crap :(
- Chef::Config[:client_key] = rest.auth_credentials.key_file
- Chef::Config[:node_name] = rest.auth_credentials.client_name
- cookbook = @cookbook_loader_not_uploaded_at_feature_start[name]
- uploader = Chef::CookbookUploader.new(cookbook, [EXTRA_COOKBOOKS], :rest => rest)
- begin
- uploader.upload_cookbook
- rescue Exception => e
- @exception = e
+ call_as_admin do
+ cookbook = @cookbook_loader_not_uploaded_at_feature_start[name]
+ uploader = Chef::CookbookUploader.new(cookbook, [EXTRA_COOKBOOKS], :rest => rest)
+ begin
+ uploader.upload_cookbook
+ rescue Exception => e
+ @exception = e
+ end
end
end
diff --git a/features/steps/node_steps.rb b/features/steps/node_steps.rb
index 13c2dff2dd..5f97044d6f 100644
--- a/features/steps/node_steps.rb
+++ b/features/steps/node_steps.rb
@@ -21,7 +21,7 @@
###
Given /^a validated node$/ do
# client should have cached ohai assigned to it
- client.register
+ client.register(ohai[:fqdn], :client_key => client_key )
client.build_node
client.node.run_list << "integration_setup"
end
diff --git a/features/steps/run_solo.rb b/features/steps/run_solo.rb
index e9157d8bd1..458e80714d 100644
--- a/features/steps/run_solo.rb
+++ b/features/steps/run_solo.rb
@@ -27,10 +27,10 @@ When /^I run chef-solo with the '(.+)' recipe$/ do |recipe_name|
binary_path = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'chef', 'bin', 'chef-solo'))
command = "#{binary_path} -c #{config_file} -j #{dna_file}"
- command += " -l debug" if ENV['LOG_LEVEL'] == 'debug'
+ command += " -l debug" if Chef::Log.debug?
# Run it
- puts "Running solo: #{command}" if ENV['LOG_LEVEL'] == 'debug'
+ puts "Running solo: #{command}" if Chef::Log.debug?
status = Chef::Mixin::Command.popen4(command) do |p, i, o, e|
@stdout = o.gets(nil)
@@ -38,7 +38,7 @@ When /^I run chef-solo with the '(.+)' recipe$/ do |recipe_name|
end
@status = status
- print_output if ENV['LOG_LEVEL'] == 'debug'
+ print_output if Chef::Log.debug?
end