From 17a6b643092c0ca75a289b52c982bab57ac9815d Mon Sep 17 00:00:00 2001 From: Hugo Wetterberg Date: Thu, 13 Sep 2012 09:14:40 +0200 Subject: [PATCH] Emitting vagrant-mount events when mounting nfs volumes --- plugins/guests/ubuntu/guest.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/guests/ubuntu/guest.rb b/plugins/guests/ubuntu/guest.rb index 76d768f41..ed4311cea 100644 --- a/plugins/guests/ubuntu/guest.rb +++ b/plugins/guests/ubuntu/guest.rb @@ -13,6 +13,17 @@ module VagrantPlugins vm.communicate.sudo("[ -x /sbin/initctl ] && /sbin/initctl emit vagrant-mounted MOUNTPOINT=#{guestpath}") end + def mount_nfs(ip, folders) + # Mount it like normal + super + + # Emit an upstart events if upstart is available + folders.each do |name, opts| + real_guestpath = expanded_guest_path(opts[:guestpath]) + vm.channel.sudo("[ -x /sbin/initctl ] && /sbin/initctl emit vagrant-mounted MOUNTPOINT=#{real_guestpath}") + end + end + def change_host_name(name) vm.communicate.tap do |comm| if !comm.test("sudo hostname | grep '#{name}'")