Emitting vagrant-mount events when mounting nfs volumes

This commit is contained in:
Hugo Wetterberg 2012-09-13 09:14:40 +02:00
parent 4c49dfe82b
commit 17a6b64309
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}'")