From ee8f9625379d0a58e2346b6fc1341225bdfe7997 Mon Sep 17 00:00:00 2001 From: Teemu Matilainen <teemu.matilainen@iki.fi> Date: Wed, 4 Dec 2013 17:24:23 -0300 Subject: [PATCH 1/2] Fix plugin loading Regression from d354cdd. --- lib/vagrant/environment.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 46899197c..62d059dd1 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -755,9 +755,9 @@ module Vagrant next end - @logger.info("Loading plugin from JSON: #{plugin}") + @logger.info("Loading plugin from JSON: #{name}") begin - Vagrant.require_plugin(plugin) + Vagrant.require_plugin(name) rescue Errors::PluginLoadError => e @ui.error(e.message + "\n") rescue Errors::PluginLoadFailed => e From 294f4def91e13d994b236390c62a672820fba6f7 Mon Sep 17 00:00:00 2001 From: Teemu Matilainen <teemu.matilainen@iki.fi> Date: Wed, 4 Dec 2013 18:23:03 -0300 Subject: [PATCH 2/2] Fix `vagrant plugin` commands `StateFile#installed_plugins` returns now a Hash instead of Array. Fixes regression from 39b2539. --- plugins/commands/plugin/action/license_plugin.rb | 2 +- plugins/commands/plugin/action/list_plugins.rb | 2 +- plugins/commands/plugin/action/plugin_exists_check.rb | 2 +- plugins/commands/plugin/action/prune_gems.rb | 2 +- plugins/commands/plugin/state_file.rb | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/commands/plugin/action/license_plugin.rb b/plugins/commands/plugin/action/license_plugin.rb index b69e52749..518c1824c 100644 --- a/plugins/commands/plugin/action/license_plugin.rb +++ b/plugins/commands/plugin/action/license_plugin.rb @@ -18,7 +18,7 @@ module VagrantPlugins def call(env) # Get the list of installed plugins according to the state file - installed = Set.new(env[:plugin_state_file].installed_plugins) + installed = env[:plugin_state_file].installed_plugins.keys # If the plugin we're trying to license doesn't exist in the # state file, then it is an error. diff --git a/plugins/commands/plugin/action/list_plugins.rb b/plugins/commands/plugin/action/list_plugins.rb index b3a3392b1..f5dd0574b 100644 --- a/plugins/commands/plugin/action/list_plugins.rb +++ b/plugins/commands/plugin/action/list_plugins.rb @@ -18,7 +18,7 @@ module VagrantPlugins def call(env) # Get the list of installed plugins according to the state file - installed = Set.new(env[:plugin_state_file].installed_plugins) + installed = env[:plugin_state_file].installed_plugins.keys # Go through the plugins installed in this environment and # get the latest version of each. diff --git a/plugins/commands/plugin/action/plugin_exists_check.rb b/plugins/commands/plugin/action/plugin_exists_check.rb index c56bd9c14..abe8d43cf 100644 --- a/plugins/commands/plugin/action/plugin_exists_check.rb +++ b/plugins/commands/plugin/action/plugin_exists_check.rb @@ -12,7 +12,7 @@ module VagrantPlugins def call(env) # Get the list of installed plugins according to the state file - installed = Set.new(env[:plugin_state_file].installed_plugins) + installed = env[:plugin_state_file].installed_plugins.keys if !installed.include?(env[:plugin_name]) raise Vagrant::Errors::PluginNotInstalled, name: env[:plugin_name] diff --git a/plugins/commands/plugin/action/prune_gems.rb b/plugins/commands/plugin/action/prune_gems.rb index ae5a38196..d5e754994 100644 --- a/plugins/commands/plugin/action/prune_gems.rb +++ b/plugins/commands/plugin/action/prune_gems.rb @@ -34,7 +34,7 @@ module VagrantPlugins @logger.info("Pruning gems...") # Get the list of installed plugins according to the state file - installed = Set.new(env[:plugin_state_file].installed_plugins) + installed = env[:plugin_state_file].installed_plugins.keys # Get the actual specifications of installed gems all_specs = env[:gem_helper].with_environment do diff --git a/plugins/commands/plugin/state_file.rb b/plugins/commands/plugin/state_file.rb index 6860bdd09..7846bf7b0 100644 --- a/plugins/commands/plugin/state_file.rb +++ b/plugins/commands/plugin/state_file.rb @@ -32,11 +32,11 @@ module VagrantPlugins save! end - # This returns a list of installed plugins according to the state + # This returns a hash of installed plugins according to the state # file. Note that this may _not_ directly match over to actually # installed gems. # - # @return [Array<String>] + # @return [Hash] def installed_plugins @data["installed"] end