core: fix potential exception case in SSHExec middleware

This commit is contained in:
Mitchell Hashimoto 2014-01-03 11:19:17 -08:00
parent b3a9e6a088
commit 074bb2c7fb
1 changed files with 5 additions and 5 deletions

View File

@ -28,11 +28,11 @@ module Vagrant
# not yet ready for SSH, so we raise this exception. # not yet ready for SSH, so we raise this exception.
raise Errors::SSHNotReady if info.nil? raise Errors::SSHNotReady if info.nil?
if info[:private_key_path] info[:private_key_path] ||= []
# Check SSH key permissions
info[:private_key_path].each do |path| # Check SSH key permissions
SSH.check_key_permissions(Pathname.new(path)) info[:private_key_path].each do |path|
end SSH.check_key_permissions(Pathname.new(path))
end end
if info[:private_key_path].empty? && info[:password] if info[:private_key_path].empty? && info[:password]