diff --git a/plugins/commands/serve/client/communicator.rb b/plugins/commands/serve/client/communicator.rb index dff7d4173..44d44048a 100644 --- a/plugins/commands/serve/client/communicator.rb +++ b/plugins/commands/serve/client/communicator.rb @@ -76,12 +76,12 @@ module VagrantPlugins value: Google::Protobuf::Any.pack(machine.to_proto) ), SDK::FuncSpec::Value.new( - type: "hashicorp.vagrant.sdk.Args.Path", - value: Google::Protobuf::Any.pack(SDK::Args::Path.new(path: from)), + type: "hashicorp.vagrant.sdk.Communicator.Path", + value: Google::Protobuf::Any.pack(SDK::Communicator::Path.new(path: from)), ), SDK::FuncSpec::Value.new( - type: "hashicorp.vagrant.sdk.Args.Path", - value: Google::Protobuf::Any.pack(SDK::Args::Path.new(path: to)), + type: "hashicorp.vagrant.sdk.Communicator.Path", + value: Google::Protobuf::Any.pack(SDK::Communicator::Path.new(path: to)), ), ] ) @@ -102,12 +102,12 @@ module VagrantPlugins value: Google::Protobuf::Any.pack(machine.to_proto) ), SDK::FuncSpec::Value.new( - type: "hashicorp.vagrant.sdk.Args.Path", - value: Google::Protobuf::Any.pack(SDK::Args::Path.new(path: from)), + type: "hashicorp.vagrant.sdk.Communicator.Path", + value: Google::Protobuf::Any.pack(SDK::Communicator::Path.new(path: from)), ), SDK::FuncSpec::Value.new( - type: "hashicorp.vagrant.sdk.Args.Path", - value: Google::Protobuf::Any.pack(SDK::Args::Path.new(path: to)), + type: "hashicorp.vagrant.sdk.Communicator.Path", + value: Google::Protobuf::Any.pack(SDK::Communicator::Path.new(path: to)), ), ] ) diff --git a/plugins/commands/serve/mappers/communicator.rb b/plugins/commands/serve/mappers/communicator.rb index a80ad0349..01af32351 100644 --- a/plugins/commands/serve/mappers/communicator.rb +++ b/plugins/commands/serve/mappers/communicator.rb @@ -17,6 +17,23 @@ module VagrantPlugins SDK::Communicator::Command.decode(proto.value.value) end end + + # Build a communicator path from a FuncSpec value + class CommunicatorPathFromSpec < Mapper + def initialize + inputs = [].tap do |i| + i << Input.new(type: SDK::FuncSpec::Value) { |arg| + arg.type == "hashicorp.vagrant.sdk.Communicator.Path" && + !arg&.value&.value.nil? + } + end + super(inputs: inputs, output: SDK::Communicator::Path, func: method(:converter)) + end + + def converter(proto) + SDK::Communicator::Path.decode(proto.value.value) + end + end end end end diff --git a/plugins/commands/serve/service/communicator_service.rb b/plugins/commands/serve/service/communicator_service.rb index 55dece408..ff54c36bf 100644 --- a/plugins/commands/serve/service/communicator_service.rb +++ b/plugins/commands/serve/service/communicator_service.rb @@ -110,11 +110,11 @@ module VagrantPlugins name: "", ), SDK::FuncSpec::Value.new( - type: "hashicorp.vagrant.sdk.Args.Path", + type: "hashicorp.vagrant.sdk.Communicator.Path", name: "", ), SDK::FuncSpec::Value.new( - type: "hashicorp.vagrant.sdk.Args.Path", + type: "hashicorp.vagrant.sdk.Communicator.Path", name: "", ) ], @@ -161,11 +161,11 @@ module VagrantPlugins name: "", ), SDK::FuncSpec::Value.new( - type: "hashicorp.vagrant.sdk.Args.Path", + type: "hashicorp.vagrant.sdk.Communicator.Path", name: "", ), SDK::FuncSpec::Value.new( - type: "hashicorp.vagrant.sdk.Args.Path", + type: "hashicorp.vagrant.sdk.Communicator.Path", name: "", ) ],