From c01a38b6e19814819f93c6c8bc3de3ef03bf5f6a Mon Sep 17 00:00:00 2001 From: sophia Date: Wed, 19 Jan 2022 14:06:15 -0600 Subject: [PATCH] Load target index targets --- .../commands/serve/client/capability_platform.rb | 15 +-------------- plugins/commands/serve/client/target_index.rb | 4 ++-- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/plugins/commands/serve/client/capability_platform.rb b/plugins/commands/serve/client/capability_platform.rb index 93966249e..efc27c8a1 100644 --- a/plugins/commands/serve/client/capability_platform.rb +++ b/plugins/commands/serve/client/capability_platform.rb @@ -32,20 +32,7 @@ module VagrantPlugins # @param [Symbol] cap_name Name of the capability def capability(cap_name, *args) logger.debug("executing capability #{cap_name}") - arg_protos = seeds.typed.map do |any| - SDK::FuncSpec::Value.new( - name: "", - type: any.type_name, - value: any, - ) - end - arg_protos += seeds.named.map do |name, any| - SDK::FuncSpec::Value.new( - name: name, - type: any.type_name, - value: any, - ) - end + arg_protos = seed_protos d = Type::Direct.new(arguments: args) da = mapper.map(d, to: Google::Protobuf::Any) arg_protos << SDK::FuncSpec::Value.new( diff --git a/plugins/commands/serve/client/target_index.rb b/plugins/commands/serve/client/target_index.rb index 2baa9f09c..80bb96563 100644 --- a/plugins/commands/serve/client/target_index.rb +++ b/plugins/commands/serve/client/target_index.rb @@ -28,7 +28,7 @@ module VagrantPlugins id: ident ) ) - machine = Target.load(resp.target, broker: broker).to_machine + machine = Target.load(resp, broker: broker).to_machine Vagrant::MachineIndex::Entry.load(machine) rescue GRPC::NotFound nil @@ -59,7 +59,7 @@ module VagrantPlugins id: ident ) ) - machine = Target.load(resp.target, broker: broker).to_machine + machine = Target.load(resp, broker: broker).to_machine machine.set_name(entry.name) machine.set_state(entry.full_state) Vagrant::MachineIndex::Entry.load(machine)