Don't load any plugins for `vagrant plugin` [GH-1418]
This commit is contained in:
parent
c22e4fe19b
commit
327ca544ef
|
@ -1,5 +1,10 @@
|
||||||
## 1.1.1 (unreleased)
|
## 1.1.1 (unreleased)
|
||||||
|
|
||||||
|
IMPROVEMENTS:
|
||||||
|
|
||||||
|
- Don't load plugins on any `vagrant plugin` command, so that errors
|
||||||
|
are avoided. [GH-1418]
|
||||||
|
|
||||||
BUG FIXES:
|
BUG FIXES:
|
||||||
|
|
||||||
- Quote keys to StringBlockEditor so keys with spaces, parens, and
|
- Quote keys to StringBlockEditor so keys with spaces, parens, and
|
||||||
|
|
|
@ -168,6 +168,12 @@ module Vagrant
|
||||||
#
|
#
|
||||||
# @param [String] name Name of the plugin to load.
|
# @param [String] name Name of the plugin to load.
|
||||||
def self.require_plugin(name)
|
def self.require_plugin(name)
|
||||||
|
if ENV["VAGRANT_NO_PLUGINS"]
|
||||||
|
logger = Log4r::Logger.new("vagrant::root")
|
||||||
|
logger.warn("VAGRANT_NO_PLUGINS is set, not loading 3rd party plugin: #{name}")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
# Redirect stdout/stderr so that we can output it in our own way.
|
# Redirect stdout/stderr so that we can output it in our own way.
|
||||||
previous_stderr = $stderr
|
previous_stderr = $stderr
|
||||||
previous_stdout = $stdout
|
previous_stdout = $stdout
|
||||||
|
@ -212,8 +218,8 @@ module Vagrant
|
||||||
:plugin => name
|
:plugin => name
|
||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
$stderr = previous_stderr
|
$stderr = previous_stderr if previous_stderr
|
||||||
$stdout = previous_stdout
|
$stdout = previous_stdout if previous_stdout
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -631,13 +631,6 @@ module Vagrant
|
||||||
# Loads the Vagrant plugins by properly setting up RubyGems so that
|
# Loads the Vagrant plugins by properly setting up RubyGems so that
|
||||||
# our private gem repository is on the path.
|
# our private gem repository is on the path.
|
||||||
def load_plugins
|
def load_plugins
|
||||||
if ENV["VAGRANT_NO_PLUGINS"]
|
|
||||||
# If this key exists, then we don't load any plugins. It is a "safe
|
|
||||||
# mode" of sorts.
|
|
||||||
@logger.warn("VAGRANT_NO_PLUGINS is set. Not loading 3rd party plugins.")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
# Add our private gem path to the gem path and reset the paths
|
# Add our private gem path to the gem path and reset the paths
|
||||||
# that Rubygems knows about.
|
# that Rubygems knows about.
|
||||||
ENV["GEM_PATH"] = "#{@gems_path}#{::File::PATH_SEPARATOR}#{ENV["GEM_PATH"]}"
|
ENV["GEM_PATH"] = "#{@gems_path}#{::File::PATH_SEPARATOR}#{ENV["GEM_PATH"]}"
|
||||||
|
|
Loading…
Reference in New Issue