2012-05-23 22:57:43 +00:00
|
|
|
require "vagrant"
|
|
|
|
|
|
|
|
require Vagrant.source_root.join("plugins/guests/debian/guest")
|
|
|
|
|
2012-04-19 04:23:25 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module GuestUbuntu
|
|
|
|
class Guest < VagrantPlugins::GuestDebian::Guest
|
2013-04-04 04:47:57 +00:00
|
|
|
def detect?(machine)
|
|
|
|
machine.communicate.test("cat /proc/version | grep 'Ubuntu'")
|
|
|
|
end
|
|
|
|
|
2012-01-13 06:57:32 +00:00
|
|
|
def mount_shared_folder(name, guestpath, options)
|
|
|
|
# Mount it like normal
|
|
|
|
super
|
|
|
|
|
|
|
|
# Emit an upstart event if upstart is available
|
2012-08-20 19:15:42 +00:00
|
|
|
vm.communicate.sudo("[ -x /sbin/initctl ] && /sbin/initctl emit vagrant-mounted MOUNTPOINT=#{guestpath}")
|
2012-01-13 06:57:32 +00:00
|
|
|
end
|
|
|
|
|
2012-09-13 07:14:40 +00:00
|
|
|
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])
|
2013-01-30 18:54:53 +00:00
|
|
|
vm.communicate.sudo("[ -x /sbin/initctl ] && /sbin/initctl emit vagrant-mounted MOUNTPOINT=#{real_guestpath}")
|
2012-09-13 07:14:40 +00:00
|
|
|
end
|
|
|
|
end
|
2011-03-01 07:38:30 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|