Merge pull request #1118 from hugowetterberg/master

Emitting vagrant-mount events when mounting nfs volumes
This commit is contained in:
Mitchell Hashimoto 2012-09-27 10:44:34 -07:00
commit 8cc0504c53
1 changed files with 11 additions and 0 deletions

View File

@ -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}'")