Update ruby execute func for new proto
This commit is contained in:
parent
3107da72af
commit
9f51d87038
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user