Pass machine to provider capabilities
This commit is contained in:
parent
52d37217ac
commit
73801703e7
@ -38,7 +38,7 @@ module Vagrant
|
||||
# @param [Symbol] cap_name Name of the capability
|
||||
def capability(cap_name, *args)
|
||||
@logger.debug("running remote provider capability #{cap_name} with args #{args}")
|
||||
client.capability(cap_name, *args)
|
||||
client.capability(cap_name, @machine, *args)
|
||||
end
|
||||
|
||||
# Tests whether the given capability is possible.
|
||||
|
||||
@ -140,6 +140,16 @@ module VagrantPlugins
|
||||
machine.env.action_runner.run(callable, env)
|
||||
end
|
||||
|
||||
def capability_arguments(args)
|
||||
target, direct = args
|
||||
nargs = direct.args.dup
|
||||
if !nargs.first.is_a?(Vagrant::Machine)
|
||||
nargs.unshift(mapper.map(target, to: Vagrant::Machine))
|
||||
end
|
||||
|
||||
nargs
|
||||
end
|
||||
|
||||
def load_provider(klass, machine)
|
||||
key = cache.key(klass, machine)
|
||||
return cache.get(key) if cache.registered?(key)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user