Better debugging on searching for capabilities

This commit is contained in:
Mitchell Hashimoto 2013-04-03 23:46:39 -07:00
parent 2f232e0175
commit 067f431ee9
3 changed files with 13 additions and 3 deletions

View File

@ -79,7 +79,7 @@ module Vagrant
# Mount them! # Mount them!
env[:machine].guest.capability( env[:machine].guest.capability(
:mount_nfs, env[:nfs_host_ip], mount_folders) :mount_nfs_folder, env[:nfs_host_ip], mount_folders)
end end
end end

View File

@ -146,9 +146,15 @@ module Vagrant
# @param [Symbol] cap_name # @param [Symbol] cap_name
# @return [Module] # @return [Module]
def capability_module(cap_name) def capability_module(cap_name)
@logger.debug("Searching for cap: #{cap_name}")
@chain.each do |guest_name, guest| @chain.each do |guest_name, guest|
@logger.debug("Checking in: #{guest_name}")
caps = @capabilities[guest_name] caps = @capabilities[guest_name]
return caps[cap_name] if caps && caps.has_key?(cap_name)
if caps && caps.has_key?(cap_name)
@logger.debug("Found cap: #{cap_name} in #{guest_name}")
return caps[cap_name]
end
end end
nil nil

View File

@ -1,8 +1,12 @@
require "vagrant/util/retryable"
module VagrantPlugins module VagrantPlugins
module GuestLinux module GuestLinux
module Cap module Cap
class MountNFS class MountNFS
def self.mount_nfs(machine, ip, folders) extend Vagrant::Util::Retryable
def self.mount_nfs_folder(machine, ip, folders)
folders.each do |name, opts| folders.each do |name, opts|
# Expand the guest path so we can handle things like "~/vagrant" # Expand the guest path so we can handle things like "~/vagrant"
expanded_guest_path = machine.guest.capability( expanded_guest_path = machine.guest.capability(