Merge pull request #8028 from chrisroberts/plugin-list-order

Iterate plugin list using manager result to retain sorting
This commit is contained in:
Chris Roberts 2016-11-22 08:13:58 -08:00 committed by GitHub
commit 011ea875df
1 changed files with 9 additions and 4 deletions

View File

@ -18,7 +18,11 @@ module VagrantPlugins
def call(env) def call(env)
manager = Vagrant::Plugin::Manager.instance manager = Vagrant::Plugin::Manager.instance
plugins = manager.installed_plugins plugins = manager.installed_plugins
specs = manager.installed_specs specs = Hash[
manager.installed_specs.map do |spec|
[spec.name, spec]
end
]
# Output! # Output!
if specs.empty? if specs.empty?
@ -26,9 +30,10 @@ module VagrantPlugins
return @app.call(env) return @app.call(env)
end end
specs.each do |spec| plugins.each do |plugin_name, plugin|
# Grab the plugin.
plugin = plugins[spec.name] spec = specs[plugin_name]
next if spec.nil?
system = "" system = ""
system = ", system" if plugin && plugin["system"] system = ", system" if plugin && plugin["system"]