summaryrefslogtreecommitdiff
path: root/lib/chef/knife
diff options
context:
space:
mode:
authordheerajd-msys <dheeraj.dubey@msystechnologies.com>2016-11-21 15:13:52 +0530
committerdheerajd-msys <dheeraj.dubey@msystechnologies.com>2016-11-22 12:31:46 +0530
commit63a6d5e5f24e26662d520b366b8604b81b757c3a (patch)
tree331d89398a3e98e59f74e5570c4ffe7669a68737 /lib/chef/knife
parent0c0ccba6a97b1a5147e1f3c9891bcf9d15ef7d4b (diff)
downloadchef-63a6d5e5f24e26662d520b366b8604b81b757c3a.tar.gz
Added specs for config_log_location
Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
Diffstat (limited to 'lib/chef/knife')
-rw-r--r--lib/chef/knife/core/bootstrap_context.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb
index cc9c6c4903..ceb067d48d 100644
--- a/lib/chef/knife/core/bootstrap_context.rb
+++ b/lib/chef/knife/core/bootstrap_context.rb
@@ -68,25 +68,23 @@ class Chef
end
def get_log_location
- if (@chef_config[:config_log_location].nil? || @chef_config[:config_log_location].empty?)
+ if !(@chef_config[:config_log_location].class == IO ) && (@chef_config[:config_log_location].nil? || @chef_config[:config_log_location].to_s.empty?)
"STDOUT"
elsif @chef_config[:config_log_location].equal?(:win_evt)
- raise "The value \:win_evt is not supported for config_log_location on Linux Platforms \n"
+ raise "The value :win_evt is not supported for config_log_location on Linux Platforms \n"
elsif @chef_config[:config_log_location].equal?(:syslog)
":syslog"
- elsif (@chef_config[:config_log_location].equal?(STDOUT))
+ elsif @chef_config[:config_log_location].equal?(STDOUT)
"STDOUT"
- elsif (@chef_config[:config_log_location].equal?(STDERR))
+ elsif @chef_config[:config_log_location].equal?(STDERR)
"STDERR"
elsif @chef_config[:config_log_location]
- %Q{"#{@chef_config[:config_log_location]}"}
+ %Q{"#{@chef_config[:config_log_location]}"}
else
"STDOUT"
end
end
-
-
def config_content
client_rb = <<-CONFIG
chef_server_url "#{@chef_config[:chef_server_url]}"