diff --git a/lib/vagrant/plugin/remote/provider.rb b/lib/vagrant/plugin/remote/provider.rb index d889e6aa8..6eb8c7f85 100644 --- a/lib/vagrant/plugin/remote/provider.rb +++ b/lib/vagrant/plugin/remote/provider.rb @@ -31,6 +31,25 @@ module Vagrant client.action(@machine.to_proto, name) end + # Executes the capability with the given name, optionally passing more + # arguments onwards to the capability. If the capability returns a value, + # it will be returned. + # + # @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) + end + + # Tests whether the given capability is possible. + # + # @param [Symbol] cap_name Capability name + # @return [Boolean] + def capability?(cap_name) + @logger.debug("checking for remote provider capability #{cap_name}") + client.has_capability?(cap_name) + end + def machine_id_changed client.machine_id_changed(@machine.to_proto) end diff --git a/plugins/commands/serve/service/provider_service.rb b/plugins/commands/serve/service/provider_service.rb index d65661afc..c05d8c34f 100644 --- a/plugins/commands/serve/service/provider_service.rb +++ b/plugins/commands/serve/service/provider_service.rb @@ -9,7 +9,7 @@ module VagrantPlugins super caps = Vagrant.plugin("2").local_manager.provider_capabilities default_args = { - Client::Target::Machine => SDK::Args::Target::Machine + Vagrant::Machine => SDK::Args::Target::Machine } initialize_capability_platform!(caps, default_args) end