From ab39125570cea3836ca691f8504ef5e232a76e48 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Wed, 18 Jul 2018 15:47:35 -0700 Subject: [PATCH] Set options directly instead of lazy merging --- lib/vagrant/environment.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 8aab2cf6a..53edce6b0 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -8,6 +8,7 @@ require 'log4r' require 'vagrant/util/file_mode' require 'vagrant/util/platform' +require 'vagrant/util/hash_with_indifferent_access' require "vagrant/util/silence_warnings" require "vagrant/vagrantfile" require "vagrant/version" @@ -950,10 +951,16 @@ module Vagrant end end needs_install.each do |name| + pconfig = Util::HashWithIndifferentAccess.new(config_plugins[name]) ui.info(I18n.t("vagrant.commands.plugin.installing", name: name)) - spec = Plugin::Manager.instance.install_plugin(name, - {sources: Vagrant::Bundler::DEFAULT_GEM_SOURCES.dup}.merge( - config_plugins[name]).merge(env_local: true)) + + options = {sources: Vagrant::Bundler::DEFAULT_GEM_SOURCES.dup, env_local: true} + options[:sources] = pconfig[:sources] if pconfig[:sources] + options[:require] = pconfig[:entry_point] if pconfig[:entry_point] + options[:version] = pconfig[:version] if pconfig[:version] + + spec = Plugin::Manager.instance.install_plugin(name, options) + ui.info(I18n.t("vagrant.commands.plugin.installed", name: spec.name, version: spec.version.to_s)) end