Merge pull request #5698 from aneeshusa/dont-report-plugins-when-disabled
If plugins are disabled, report them as not available.
This commit is contained in:
commit
2175625b61
|
@ -139,10 +139,12 @@ module Vagrant
|
||||||
Config.run(version, &block)
|
Config.run(version, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
# This checks if a plugin with the given name is installed. This can
|
# This checks if a plugin with the given name is available (installed
|
||||||
# be used from the Vagrantfile to easily branch based on plugin
|
# and enabled). This can be used from the Vagrantfile to easily branch
|
||||||
# availability.
|
# based on plugin availability.
|
||||||
def self.has_plugin?(name, version=nil)
|
def self.has_plugin?(name, version=nil)
|
||||||
|
return false unless Vagrant.plugins_enabled?
|
||||||
|
|
||||||
if !version
|
if !version
|
||||||
# We check the plugin names first because those are cheaper to check
|
# We check the plugin names first because those are cheaper to check
|
||||||
return true if plugin("2").manager.registered.any? { |p| p.name == name }
|
return true if plugin("2").manager.registered.any? { |p| p.name == name }
|
||||||
|
|
Loading…
Reference in New Issue