diff --git a/lib/vagrant/environment/remote.rb b/lib/vagrant/environment/remote.rb index c52300502..12e6012ed 100644 --- a/lib/vagrant/environment/remote.rb +++ b/lib/vagrant/environment/remote.rb @@ -80,8 +80,11 @@ module Vagrant # # @return [Class] def host - h = @client.host - Vagrant::Host.new(h, nil, nil, self) + if !@host + h = @client.host + @host = Vagrant::Host.new(h, nil, nil, self) + end + @host end # Gets a target (machine) by name diff --git a/plugins/commands/serve/service/capability_platform_service.rb b/plugins/commands/serve/service/capability_platform_service.rb index 286717621..801b3187b 100644 --- a/plugins/commands/serve/service/capability_platform_service.rb +++ b/plugins/commands/serve/service/capability_platform_service.rb @@ -105,6 +105,14 @@ module VagrantPlugins result = cap_method.call(*args) + logger.debug("got result #{result}") + if result.nil? || (result.respond_to?(:empty?) && result.empty?) + logger.debug("got empty result, returning empty response") + return SDK::Platform::Capability::Resp.new( + result: nil + ) + end + val = Google::Protobuf::Value.new val.from_ruby(result) SDK::Platform::Capability::Resp.new(