From 067f431ee9f2afefd253cd628ac385b034a005c7 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 3 Apr 2013 23:46:39 -0700 Subject: [PATCH] Better debugging on searching for capabilities --- lib/vagrant/action/builtin/nfs.rb | 2 +- lib/vagrant/guest.rb | 8 +++++++- plugins/guests/linux/cap/mount_nfs.rb | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/action/builtin/nfs.rb b/lib/vagrant/action/builtin/nfs.rb index 05ec94bc1..17db963b2 100644 --- a/lib/vagrant/action/builtin/nfs.rb +++ b/lib/vagrant/action/builtin/nfs.rb @@ -79,7 +79,7 @@ module Vagrant # Mount them! env[:machine].guest.capability( - :mount_nfs, env[:nfs_host_ip], mount_folders) + :mount_nfs_folder, env[:nfs_host_ip], mount_folders) end end diff --git a/lib/vagrant/guest.rb b/lib/vagrant/guest.rb index 5629af70f..bc427df0b 100644 --- a/lib/vagrant/guest.rb +++ b/lib/vagrant/guest.rb @@ -146,9 +146,15 @@ module Vagrant # @param [Symbol] cap_name # @return [Module] def capability_module(cap_name) + @logger.debug("Searching for cap: #{cap_name}") @chain.each do |guest_name, guest| + @logger.debug("Checking in: #{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 nil diff --git a/plugins/guests/linux/cap/mount_nfs.rb b/plugins/guests/linux/cap/mount_nfs.rb index efff4fea3..69d4e92f2 100644 --- a/plugins/guests/linux/cap/mount_nfs.rb +++ b/plugins/guests/linux/cap/mount_nfs.rb @@ -1,8 +1,12 @@ +require "vagrant/util/retryable" + module VagrantPlugins module GuestLinux module Cap 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| # Expand the guest path so we can handle things like "~/vagrant" expanded_guest_path = machine.guest.capability(