core: can't add boxes from network shares [GH-3279]
This commit is contained in:
parent
9529dd8cde
commit
41636a8a9c
|
@ -13,6 +13,7 @@ BUG FIXES:
|
||||||
fail [GH-3391]
|
fail [GH-3391]
|
||||||
- core: `vagrant` on Windows cmd.exe doesn't always exit with exit
|
- core: `vagrant` on Windows cmd.exe doesn't always exit with exit
|
||||||
code zero. [GH-3420]
|
code zero. [GH-3420]
|
||||||
|
- core: Adding a box from a network share has nice error on Windows. [GH-3279]
|
||||||
- commands/package: Nice error if includes contain symlinks. [GH-3200]
|
- commands/package: Nice error if includes contain symlinks. [GH-3200]
|
||||||
- commands/rsync-auto: Don't crash if the machine can't be communicated
|
- commands/rsync-auto: Don't crash if the machine can't be communicated
|
||||||
to. [GH-3419]
|
to. [GH-3419]
|
||||||
|
|
|
@ -41,6 +41,12 @@ module Vagrant
|
||||||
# Expand the path and try to use that, if possible
|
# Expand the path and try to use that, if possible
|
||||||
p = File.expand_path(URI.unescape(u.gsub(/^file:\/\//, "")))
|
p = File.expand_path(URI.unescape(u.gsub(/^file:\/\//, "")))
|
||||||
p = Util::Platform.cygwin_windows_path(p)
|
p = Util::Platform.cygwin_windows_path(p)
|
||||||
|
|
||||||
|
# If this is a network share on Windows then show the user an error
|
||||||
|
if Util::Platform.windows? && (p.start_with?("//") || p.start_with?("\\\\"))
|
||||||
|
raise Errors::BoxUrlIsNetworkShare, url: p
|
||||||
|
end
|
||||||
|
|
||||||
next "file://#{URI.escape(p.gsub("\\", "/"))}" if File.file?(p)
|
next "file://#{URI.escape(p.gsub("\\", "/"))}" if File.file?(p)
|
||||||
|
|
||||||
u
|
u
|
||||||
|
|
|
@ -232,6 +232,10 @@ module Vagrant
|
||||||
error_key(:box_update_no_metadata)
|
error_key(:box_update_no_metadata)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class BoxUrlIsNetworkShare < VagrantError
|
||||||
|
error_key(:box_url_is_network_share)
|
||||||
|
end
|
||||||
|
|
||||||
class BoxVerificationFailed < VagrantError
|
class BoxVerificationFailed < VagrantError
|
||||||
error_key(:failed, "vagrant.actions.box.verify")
|
error_key(:failed, "vagrant.actions.box.verify")
|
||||||
end
|
end
|
||||||
|
|
|
@ -495,6 +495,13 @@ en:
|
||||||
directly instead of from a box catalog. Vagrant can only
|
directly instead of from a box catalog. Vagrant can only
|
||||||
check the versions of boxes that were added from a catalog
|
check the versions of boxes that were added from a catalog
|
||||||
such as from the public Vagrant Server.
|
such as from the public Vagrant Server.
|
||||||
|
box_url_is_network_share: |-
|
||||||
|
You specified a network share path as a path to add a box. Vagrant
|
||||||
|
current doesn't support network share URLs. Please copy the file
|
||||||
|
from the network share to your local machine, then add it from
|
||||||
|
there.
|
||||||
|
|
||||||
|
URL: %{url}
|
||||||
bundler_disabled: |-
|
bundler_disabled: |-
|
||||||
Vagrant's built-in bundler management mechanism is disabled because
|
Vagrant's built-in bundler management mechanism is disabled because
|
||||||
Vagrant is running in an external bundler environment. In these
|
Vagrant is running in an external bundler environment. In these
|
||||||
|
|
Loading…
Reference in New Issue