Return capability execution result
This commit is contained in:
parent
97baac8772
commit
14d17dfd9d
@ -32,11 +32,6 @@ module Vagrant
|
||||
# @param [Symbol] cap_name Name of the capability
|
||||
def capability(cap_name, *args)
|
||||
@logger.debug("running remote host capability #{cap_name} with args #{args}")
|
||||
if !client.has_capability?(cap_name)
|
||||
raise Errors::GuestCapabilityNotFound,
|
||||
cap: cap_name.to_s,
|
||||
guest: name
|
||||
end
|
||||
client.capability(cap_name, @env.to_proto, *args)
|
||||
end
|
||||
|
||||
|
||||
@ -19,7 +19,8 @@ module VagrantPlugins
|
||||
value: Google::Protobuf::Any.pack(val)
|
||||
)]
|
||||
)
|
||||
res = client.has_capability(req)
|
||||
|
||||
res = @client.has_capability(req)
|
||||
@logger.debug("got result #{res}")
|
||||
|
||||
res.has_capability
|
||||
|
||||
@ -101,7 +101,13 @@ module VagrantPlugins
|
||||
cap_method = target_cap.method(cap_name)
|
||||
|
||||
# TODO: pass in other args too
|
||||
cap_method.call(machine)
|
||||
resp = cap_method.call({})
|
||||
|
||||
val = Google::Protobuf::Value.new
|
||||
val.from_ruby(resp)
|
||||
SDK::Platform::Capability::Resp.new(
|
||||
result: Google::Protobuf::Any.pack(val)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user