Merge pull request #1717 from toretore/master

guests/ubuntu: Emit Ubuntu Upstart 'vagrant-mounted' (regression)
This commit is contained in:
Mitchell Hashimoto 2013-09-01 13:43:26 -07:00
commit 8bc01c7cb1
3 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,18 @@
require_relative '../../linux/cap/mount_nfs'
module VagrantPlugins
module GuestUbuntu
module Cap
class MountNFS < GuestLinux::Cap::MountNFS
def self.mount_nfs_folder(machine, ip, folders)
super
# Emit an upstart events if upstart is available
folders.each do |name, opts|
real_guestpath = machine.guest.capability(:shell_expand_guest_path, opts[:guestpath])
machine.communicate.sudo("[ -x /sbin/initctl ] && /sbin/initctl emit vagrant-mounted MOUNTPOINT=#{real_guestpath}")
end
end
end
end
end
end

View File

@ -0,0 +1,14 @@
require_relative '../../linux/cap/mount_virtualbox_shared_folder'
module VagrantPlugins
module GuestUbuntu
module Cap
class MountVirtualBoxSharedFolder < GuestLinux::Cap::MountVirtualBoxSharedFolder
def self.mount_virtualbox_shared_folder(machine, name, guestpath, options)
super
machine.communicate.sudo("[ -x /sbin/initctl ] && /sbin/initctl emit vagrant-mounted MOUNTPOINT=#{guestpath}")
end
end
end
end
end

View File

@ -15,6 +15,17 @@ module VagrantPlugins
require_relative "cap/change_host_name"
Cap::ChangeHostName
end
guest_capability("ubuntu", "mount_virtualbox_shared_folder") do
require_relative "cap/mount_virtualbox_shared_folder"
Cap::MountVirtualBoxSharedFolder
end
#I don't know if this works or not
#guest_capability("linux", "mount_nfs_folder") do
# require_relative "cap/mount_nfs"
# Cap::MountNFS
#end
end
end
end