providers/virtualbox: make ID os-friendly for Windows
This commit is contained in:
parent
a908b191b0
commit
7ccf7fadf2
|
@ -14,7 +14,7 @@ module VagrantPlugins
|
||||||
hostpath = Vagrant::Util::Platform.cygwin_windows_path(data[:hostpath])
|
hostpath = Vagrant::Util::Platform.cygwin_windows_path(data[:hostpath])
|
||||||
|
|
||||||
defs << {
|
defs << {
|
||||||
name: id,
|
name: os_friendly_id(id),
|
||||||
hostpath: hostpath.to_s,
|
hostpath: hostpath.to_s,
|
||||||
transient: data[:transient],
|
transient: data[:transient],
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,8 @@ module VagrantPlugins
|
||||||
|
|
||||||
# Mount the actual folder
|
# Mount the actual folder
|
||||||
machine.guest.capability(
|
machine.guest.capability(
|
||||||
:mount_virtualbox_shared_folder, id, data[:guestpath], data)
|
:mount_virtualbox_shared_folder,
|
||||||
|
os_friendly_id(id), data[:guestpath], data)
|
||||||
else
|
else
|
||||||
# If no guest path is specified, then automounting is disabled
|
# If no guest path is specified, then automounting is disabled
|
||||||
machine.ui.detail(I18n.t("vagrant.actions.vm.share_folders.nomount_entry",
|
machine.ui.detail(I18n.t("vagrant.actions.vm.share_folders.nomount_entry",
|
||||||
|
@ -72,6 +73,10 @@ module VagrantPlugins
|
||||||
def driver(machine)
|
def driver(machine)
|
||||||
machine.provider.driver
|
machine.provider.driver
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def os_friendly_id(id)
|
||||||
|
id.gsub(/[\/]/,'_').sub(/^_/, '')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue