Return empty response if capability returns an empty response
This commit is contained in:
parent
46aa1b3e4e
commit
45cfcc4c34
@ -80,8 +80,11 @@ module Vagrant
|
||||
#
|
||||
# @return [Class]
|
||||
def host
|
||||
if !@host
|
||||
h = @client.host
|
||||
Vagrant::Host.new(h, nil, nil, self)
|
||||
@host = Vagrant::Host.new(h, nil, nil, self)
|
||||
end
|
||||
@host
|
||||
end
|
||||
|
||||
# Gets a target (machine) by name
|
||||
|
||||
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user