Add get commands implementation to client and server
This commit is contained in:
parent
29a5c1b855
commit
067e6aeed1
@ -121,3 +121,16 @@ func (r *RubyVagrantClient) ParseVagrantfileProvider(provider string, subvm *vag
|
|||||||
|
|
||||||
return resp.Data, nil
|
return resp.Data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *RubyVagrantClient) GetCommands() ([]*vagrant_plugin_sdk.Command_CommandInfo, error) {
|
||||||
|
resp, err := r.client.GetCommands(
|
||||||
|
context.Background(),
|
||||||
|
&emptypb.Empty{},
|
||||||
|
)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp.Commands, nil
|
||||||
|
}
|
||||||
|
|||||||
@ -69,6 +69,16 @@ module VagrantPlugins
|
|||||||
parse_item_to_proto(config.vm.get_provider_overrides(provider))
|
parse_item_to_proto(config.vm.get_provider_overrides(provider))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_commands(req, _)
|
||||||
|
s = CommandService.new(broker: :stub)
|
||||||
|
infos = Vagrant.plugin("2").local_manager.commands.keys.map do |n|
|
||||||
|
s.send(:collect_command_info, n.to_s, [])
|
||||||
|
end
|
||||||
|
Hashicorp::Vagrant::GetCommandsResponse.new(
|
||||||
|
commands: infos,
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
def parse_item(item)
|
def parse_item(item)
|
||||||
loader = Vagrant::Config::Loader.new(
|
loader = Vagrant::Config::Loader.new(
|
||||||
Vagrant::Config::VERSIONS,
|
Vagrant::Config::VERSIONS,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user