lib/chef/shef.rb in chef-0.10.8 vs lib/chef/shef.rb in chef-0.10.10.beta.1
- old
+ new
@@ -142,11 +142,11 @@
puts "Ohai2u#{greeting}!"
end
def self.greeting
" #{Etc.getlogin}@#{Shef.session.node.fqdn}"
- rescue NameError
+ rescue NameError, ArgumentError
""
end
def self.parse_json
# HACK: copied verbatim from chef/application/client, because it's not
@@ -301,10 +301,10 @@
private
def config_file_for_shef_mode(environment)
if config[:config_file]
config[:config_file]
- elsif environment
+ elsif environment && ENV['HOME']
Shef.env = environment
config_file_to_try = ::File.join(ENV['HOME'], '.chef', environment, 'shef.rb')
unless ::File.exist?(config_file_to_try)
puts "could not find shef config for environment #{environment} at #{config_file_to_try}"
exit 1