Allow options hash for action on provider client

This commit is contained in:
Chris Roberts 2022-02-09 09:25:51 -08:00 committed by Paul Hinze
parent 8867dfc33c
commit ea3932be22
No known key found for this signature in database
GPG key ID: B69DEDF2D55501C0

View file

@ -62,8 +62,14 @@ module VagrantPlugins
# @param [Sdk::Args::Machine]
# @param [Symbol] name of the action to run
def action(machine, name)
run_func(Type::Direct.new(value: [machine]), func_args: name)
def action(machine, name, opts={})
opts = {} if !opts.is_a?(Hash)
opts.compact!
run_func(
Type::Direct.new(value: [machine]),
Type::Options.new(value: opts),
func_args: name,
)
end
# Generate callback and spec for required arguments