Handle the case a plugin install is a plugin not found
This commit is contained in:
parent
2079941e7d
commit
635949980b
|
@ -344,6 +344,10 @@ module Vagrant
|
||||||
error_key(:plugin_install_bad_entry_point)
|
error_key(:plugin_install_bad_entry_point)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class PluginInstallNotFound < VagrantError
|
||||||
|
error_key(:plugin_install_not_found)
|
||||||
|
end
|
||||||
|
|
||||||
class PluginLoadError < VagrantError
|
class PluginLoadError < VagrantError
|
||||||
status_code(81)
|
status_code(81)
|
||||||
error_key(:plugin_load_error)
|
error_key(:plugin_load_error)
|
||||||
|
|
|
@ -22,7 +22,13 @@ module VagrantPlugins
|
||||||
:name => plugin_name))
|
:name => plugin_name))
|
||||||
installed_gems = env[:gem_helper].with_environment do
|
installed_gems = env[:gem_helper].with_environment do
|
||||||
installer = Gem::DependencyInstaller.new(:document => [])
|
installer = Gem::DependencyInstaller.new(:document => [])
|
||||||
|
|
||||||
|
begin
|
||||||
installer.install(plugin_name)
|
installer.install(plugin_name)
|
||||||
|
rescue Gem::GemNotFoundException
|
||||||
|
raise Vagrant::Errors::PluginInstallNotFound,
|
||||||
|
:name => plugin_name
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# The plugin spec is the last installed gem since RubyGems
|
# The plugin spec is the last installed gem since RubyGems
|
||||||
|
|
|
@ -175,6 +175,9 @@ en:
|
||||||
the entry point doesn't exist. The entry point attempted was
|
the entry point doesn't exist. The entry point attempted was
|
||||||
'%{entry_point}'. If this is not correct, please manually
|
'%{entry_point}'. If this is not correct, please manually
|
||||||
specify an `--entry-point` when installing the plugin.
|
specify an `--entry-point` when installing the plugin.
|
||||||
|
plugin_install_not_found: |-
|
||||||
|
The plugin '%{name}' could not be found in local or remote
|
||||||
|
repositories. Please check the name of the plugin and try again.
|
||||||
plugin_load_error: |-
|
plugin_load_error: |-
|
||||||
The plugin "%{plugin}" could not be found. Please make sure that it is
|
The plugin "%{plugin}" could not be found. Please make sure that it is
|
||||||
properly installed via `vagrant plugin`.
|
properly installed via `vagrant plugin`.
|
||||||
|
|
Loading…
Reference in New Issue