Update ruby execute func for new proto

This commit is contained in:
sophia 2021-04-21 15:11:47 -05:00 committed by Paul Hinze
parent 3107da72af
commit 9f51d87038
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
6 changed files with 7 additions and 10 deletions

View File

@ -37,7 +37,7 @@ func (c *Command) Documentation() (*docs.Documentation, error) {
}
// ExecuteFunc implements component.Command
func (c *Command) ExecuteFunc(name []string) interface{} {
func (c *Command) ExecuteFunc([]string) interface{} {
return c.Execute
}

View File

@ -35,7 +35,7 @@ func (c *DoThing) Documentation() (*docs.Documentation, error) {
}
// ExecuteFunc implements component.Command
func (c *DoThing) ExecuteFunc(name []string) interface{} {
func (c *DoThing) ExecuteFunc([]string) interface{} {
return c.Execute
}

View File

@ -37,7 +37,7 @@ func (c *Info) Documentation() (*docs.Documentation, error) {
}
// ExecuteFunc implements component.Command
func (c *Info) ExecuteFunc(name []string) interface{} {
func (c *Info) ExecuteFunc([]string) interface{} {
return c.Execute
}

View File

@ -87,9 +87,6 @@ func (b *Basis) Init() (result *vagrant_server.Job_InitResult, err error) {
f := b.factories[component.CommandType]
result = &vagrant_server.Job_InitResult{}
for _, name := range f.Registered() {
if name != "myplugin" {
continue
}
c, err := componentCreatorMap[component.CommandType].Create(context.Background(), b, name)
if err != nil {
b.logger.Error("failed to start plugin", "name", name, "error", err)

View File

@ -143,8 +143,8 @@ module Hashicorp
rpc :Documentation, ::Google::Protobuf::Empty, ::Hashicorp::Vagrant::Sdk::Config::Documentation
rpc :ExecuteSpec, ::Hashicorp::Vagrant::Sdk::Command::SpecReq, ::Hashicorp::Vagrant::Sdk::FuncSpec
rpc :Execute, ::Hashicorp::Vagrant::Sdk::Command::ExecuteReq, ::Hashicorp::Vagrant::Sdk::Command::ExecuteResp
rpc :CommandInfoSpec, ::Hashicorp::Vagrant::Sdk::Command::SpecReq, ::Hashicorp::Vagrant::Sdk::FuncSpec
rpc :CommandInfo, ::Hashicorp::Vagrant::Sdk::Command::CommandInfoReq, ::Hashicorp::Vagrant::Sdk::Command::CommandInfoResp
rpc :CommandInfoSpec, ::Google::Protobuf::Empty, ::Hashicorp::Vagrant::Sdk::FuncSpec
rpc :CommandInfo, ::Google::Protobuf::Empty, ::Hashicorp::Vagrant::Sdk::Command::CommandInfoResp
end
Stub = Service.rpc_stub_class

View File

@ -245,10 +245,10 @@ module VagrantPlugins
def execute(req, ctx)
ServiceInfo.with_info(ctx) do |info|
plugin_name = info.plugin_name
raw_terminal = req.args.detect { |a|
raw_terminal = req.args.args.detect { |a|
a.type == "hashicorp.vagrant.sdk.Args.TerminalUI"
}&.value&.value
raw_args = req.args.detect { |a|
raw_args = req.args.args.detect { |a|
a.type == "hashicorp.vagrant.sdk.Command.Arguments"
}&.value&.value