guests/linux: emit upstart event for vagrant mounted if avail [GH-2502]
This commit is contained in:
parent
602505a136
commit
195f0d9639
|
@ -31,6 +31,8 @@ IMPROVEMENTS:
|
|||
stdin works!
|
||||
- communicators/ssh: new configuration `config.ssh.pty` is a boolean for
|
||||
whether you want ot use a PTY for provisioning.
|
||||
- guests/linux: emit upstart event `vagrant-mounted` if upstart is
|
||||
available. [GH-2502]
|
||||
- providers/virtualbox: Enable symlinks for VirtualBox 4.1. [GH-2414]
|
||||
- providers/virtualbox: default VM name now includes milliseconds with
|
||||
a random number to try to avoid conflicts in CI environments. [GH-2482]
|
||||
|
|
|
@ -68,8 +68,11 @@ module VagrantPlugins
|
|||
chown_commands << "chown #{mount_uid}:#{mount_gid_old} #{expanded_guest_path}"
|
||||
|
||||
exit_status = machine.communicate.sudo(chown_commands[0], error_check: false)
|
||||
return if exit_status == 0
|
||||
machine.communicate.sudo(chown_commands[1])
|
||||
machine.communicate.sudo(chown_commands[1]) if exit_status != 0
|
||||
|
||||
# Emit an upstart event if we can
|
||||
machine.communicate.sudo("[ -x /sbin/initctl ] && " +
|
||||
"/sbin/initctl emit vagrant-mounted MOUNTPOINT=#{guestpath}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
require Vagrant.source_root.join("plugins/guests/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
|
|
@ -22,11 +22,6 @@ module VagrantPlugins
|
|||
require_relative "cap/mount_nfs"
|
||||
Cap::MountNFS
|
||||
end
|
||||
|
||||
guest_capability("ubuntu", "mount_virtualbox_shared_folder") do
|
||||
require_relative "cap/mount_virtualbox_shared_folder"
|
||||
Cap::MountVirtualBoxSharedFolder
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue