Return a result from an up action
This commit is contained in:
parent
e56013a6b4
commit
41f3af51af
18
lib/proto/gen/plugin/plugin_server_pb.rb
Normal file
18
lib/proto/gen/plugin/plugin_server_pb.rb
Normal file
@ -0,0 +1,18 @@
|
||||
# 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
|
||||
8
lib/proto/plugin_server.proto
Normal file
8
lib/proto/plugin_server.proto
Normal file
@ -0,0 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package hashicorp.vagrant;
|
||||
|
||||
message UpResult {
|
||||
bool success = 1;
|
||||
}
|
||||
|
||||
@ -3,3 +3,9 @@
|
||||
These are plugins that ship with Vagrant. Vagrant core uses its own
|
||||
plugin system to power a lot of the core pieces that ship with Vagrant.
|
||||
Each plugin will have its own README which explains its specific role.
|
||||
|
||||
## Generate proto
|
||||
|
||||
```
|
||||
grpc_tools_ruby_protoc -I . --ruby_out=gen/plugin --grpc_out=gen/plugin ./plugin_server.proto
|
||||
```
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
|
||||
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'
|
||||
|
||||
@ -37,6 +38,7 @@ module VagrantPlugins
|
||||
def action_up(req, _unused_call)
|
||||
machine = machine_arg_to_machine(req)
|
||||
LOG.debug(machine)
|
||||
Hashicorp::Vagrant::UpResult.new(success: true)
|
||||
end
|
||||
|
||||
def machine_arg_to_machine(req)
|
||||
@ -60,8 +62,12 @@ module VagrantPlugins
|
||||
),
|
||||
]
|
||||
result = [
|
||||
nil,
|
||||
Hashicorp::Vagrant::Sdk::FuncSpec::Value.new(
|
||||
type: "hashicorp.vagrant.UpResult",
|
||||
name: ""
|
||||
),
|
||||
]
|
||||
|
||||
Hashicorp::Vagrant::Sdk::FuncSpec.new(
|
||||
args: args,
|
||||
result: result
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user