From cca19f82418d42f1330d4c6e7e3fd0048c99cb6c Mon Sep 17 00:00:00 2001 From: mbrodala Date: Tue, 20 Jan 2015 08:37:22 +0100 Subject: [PATCH] Check plugin name with version spec in has_plugin If one passes a version spec to `Vagrant.has_plugin?`, the actual plugin name is ignored and any installed plugin which matches the version spec makes the check pass. Fix this by also checking for plugin name match in addition to the requested version spec. --- lib/vagrant.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant.rb b/lib/vagrant.rb index 4b5dc84ba..1fb9c49d6 100644 --- a/lib/vagrant.rb +++ b/lib/vagrant.rb @@ -156,7 +156,7 @@ module Vagrant Plugin::Manager.instance.installed_specs.any? do |s| match = s.name == name next match if !version - next version.satisfied_by?(s.version) + next match && version.satisfied_by?(s.version) end end