From cd04e4385f3cbd028528b88c980cd312f33ac4ed Mon Sep 17 00:00:00 2001 From: sophia Date: Mon, 30 Nov 2020 15:46:02 -0600 Subject: [PATCH] Return list of installed plugins --- Gemfile | 2 -- plugins/commands/serve/service/plugin_service.rb | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 69495bdbb..565ca7959 100644 --- a/Gemfile +++ b/Gemfile @@ -7,5 +7,3 @@ if File.exist?(File.expand_path("../../vagrant-spec", __FILE__)) else gem 'vagrant-spec', git: "https://github.com/hashicorp/vagrant-spec.git", branch: :main end - -gem "pry-byebug" diff --git a/plugins/commands/serve/service/plugin_service.rb b/plugins/commands/serve/service/plugin_service.rb index 871b35b6c..302ee9c96 100644 --- a/plugins/commands/serve/service/plugin_service.rb +++ b/plugins/commands/serve/service/plugin_service.rb @@ -1,3 +1,5 @@ +require "vagrant/plugin/manager" + require_relative 'proto/gen/ruby-server_pb' require_relative 'proto/gen/ruby-server_services_pb' @@ -6,8 +8,8 @@ module VagrantPlugins module Serve class PluginService < Hashicorp::Vagrant::RubyVagrant::Service def get_plugins(req, _unused_call) - - plugins = [Hashicorp::Vagrant::Plugin.new(name: "test")] + ruby_plugins = Vagrant::Plugin::Manager.instance.installed_plugins + ruby_plugins.map { |k, v| Hashicorp::Vagrant::Plugin.new(name: k) } Hashicorp::Vagrant::GetPluginsResponse.new( plugins: plugins )