From 773c4bd910fdb87dffc07b5ec4ef898fba94cc6a Mon Sep 17 00:00:00 2001 From: sophia Date: Fri, 8 Jan 2021 14:41:20 -0600 Subject: [PATCH] Return an ActionResp --- lib/proto/gen/plugin/plugin_pb.rb | 3 +++ lib/proto/gen/plugin/plugin_server_pb.rb | 18 ------------------ lib/proto/plugin_server.proto | 8 -------- .../commands/serve/service/provider_service.rb | 6 ++---- 4 files changed, 5 insertions(+), 30 deletions(-) delete mode 100644 lib/proto/gen/plugin/plugin_server_pb.rb delete mode 100644 lib/proto/plugin_server.proto diff --git a/lib/proto/gen/plugin/plugin_pb.rb b/lib/proto/gen/plugin/plugin_pb.rb index 56c758a47..e405417d1 100644 --- a/lib/proto/gen/plugin/plugin_pb.rb +++ b/lib/proto/gen/plugin/plugin_pb.rb @@ -193,6 +193,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do end add_message "hashicorp.vagrant.sdk.Provider.ActionResp" do optional :result, :message, 1, "google.protobuf.Any" + map :labels, :string, :string, 2 + optional :template_data, :bytes, 3 + optional :success, :bool, 4 end add_message "hashicorp.vagrant.sdk.Communicator" do end diff --git a/lib/proto/gen/plugin/plugin_server_pb.rb b/lib/proto/gen/plugin/plugin_server_pb.rb deleted file mode 100644 index 1c96d9a42..000000000 --- a/lib/proto/gen/plugin/plugin_server_pb.rb +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: plugin_server.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("plugin_server.proto", :syntax => :proto3) do - add_message "hashicorp.vagrant.UpResult" do - optional :success, :bool, 1 - end - end -end - -module Hashicorp - module Vagrant - UpResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.UpResult").msgclass - end -end diff --git a/lib/proto/plugin_server.proto b/lib/proto/plugin_server.proto deleted file mode 100644 index 5cdc5cc63..000000000 --- a/lib/proto/plugin_server.proto +++ /dev/null @@ -1,8 +0,0 @@ -syntax = "proto3"; - -package hashicorp.vagrant; - -message UpResult { - bool success = 1; -} - diff --git a/plugins/commands/serve/service/provider_service.rb b/plugins/commands/serve/service/provider_service.rb index 9f4e4319a..f14dd8753 100644 --- a/plugins/commands/serve/service/provider_service.rb +++ b/plugins/commands/serve/service/provider_service.rb @@ -1,7 +1,6 @@ require 'proto/gen/plugin/plugin_pb' require 'proto/gen/plugin/plugin_services_pb' -require 'proto/gen/plugin/plugin_server_pb' require 'vagrant/machine' require 'logger' @@ -38,7 +37,7 @@ module VagrantPlugins def action_up(req, _unused_call) machine = machine_arg_to_machine(req) LOG.debug(machine) - Hashicorp::Vagrant::UpResult.new(success: true) + Hashicorp::Vagrant::Sdk::Provider::ActionResp.new(success: true) end def machine_arg_to_machine(req) @@ -63,11 +62,10 @@ module VagrantPlugins ] result = [ Hashicorp::Vagrant::Sdk::FuncSpec::Value.new( - type: "hashicorp.vagrant.UpResult", + type: "hashicorp.vagrant.sdk.Provider.ActionResp", name: "" ), ] - Hashicorp::Vagrant::Sdk::FuncSpec.new( args: args, result: result