Return an ActionResp

This commit is contained in:
sophia 2021-01-08 14:41:20 -06:00 committed by Paul Hinze
parent 41f3af51af
commit 773c4bd910
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
4 changed files with 5 additions and 30 deletions

View File

@ -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

View File

@ -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

View File

@ -1,8 +0,0 @@
syntax = "proto3";
package hashicorp.vagrant;
message UpResult {
bool success = 1;
}

View File

@ -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