Map ouput of capabilities

This commit is contained in:
sophia 2021-12-20 11:08:02 -06:00 committed by Paul Hinze
parent 8e85561f61
commit 88e1e5c1a7
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
3 changed files with 8 additions and 6 deletions

View File

@ -60,7 +60,12 @@ module VagrantPlugins
args: arg_protos,
)
)
client.capability(req)
result = client.capability(req)
if result.result.nil?
return nil
end
unmapped = mapper.map(result.result)
unmapped
end
end
end

View File

@ -108,10 +108,9 @@ module VagrantPlugins
)
end
val = Google::Protobuf::Value.new
val.from_ruby(result)
val = mapper.map(result, to: Google::Protobuf::Any)
SDK::Platform::Capability::Resp.new(
result: Google::Protobuf::Any.pack(val)
result: val
)
end
end

View File

@ -212,8 +212,6 @@ module VagrantPlugins
exit_code = communicator.execute(cmd.command, opts) {
|type, data| output[type] << data if output[type]
}
logger.debug("command exit code: #{exit_code}")
logger.debug("command output: #{output}")
SDK::Communicator::ExecuteResp.new(
exit_code: exit_code,