diff --git a/plugins/commands/serve/client/guest.rb b/plugins/commands/serve/client/guest.rb index b2a7f71dc..0a88313cb 100644 --- a/plugins/commands/serve/client/guest.rb +++ b/plugins/commands/serve/client/guest.rb @@ -8,6 +8,7 @@ module VagrantPlugins prepend Util::HasLogger include CapabilityPlatform + include Util::HasSeeds::Client # @return [] parents def parents diff --git a/plugins/commands/serve/client/host.rb b/plugins/commands/serve/client/host.rb index 822dc7ac1..81545968e 100644 --- a/plugins/commands/serve/client/host.rb +++ b/plugins/commands/serve/client/host.rb @@ -8,6 +8,7 @@ module VagrantPlugins prepend Util::HasLogger include CapabilityPlatform + include Util::HasSeeds::Client # @return [] parents def parents diff --git a/plugins/commands/serve/service/capability_platform_service.rb b/plugins/commands/serve/service/capability_platform_service.rb index 801b3187b..fcee1eb2f 100644 --- a/plugins/commands/serve/service/capability_platform_service.rb +++ b/plugins/commands/serve/service/capability_platform_service.rb @@ -7,6 +7,7 @@ module VagrantPlugins def self.included(klass) klass.include(Util::ServiceInfo) + klass.include(Util::HasSeeds::Service) klass.prepend(Util::HasMapper) klass.prepend(Util::HasBroker) klass.prepend(Util::HasLogger) @@ -22,16 +23,6 @@ module VagrantPlugins @default_args = default_args end - # TODO(spox): request scoping for seed values - needs investigation - def seed(req, ctx) - @seeds = req.arguments.to_a - Empty.new - end - - def seeds(req, ctx) - SDK::Args::Direct.new(arguments: @seeds) - end - def has_capability_spec(*_) SDK::FuncSpec.new( name: "has_capability_spec", @@ -54,7 +45,7 @@ module VagrantPlugins with_info(ctx) do |info| cap_name = mapper.funcspec_map(req) plugin_name = info.plugin_name - logger.debug("checking for #{cap_name} capability in #{plugin_name}") + logger.debug("checking for #{cap_name.inspect} capability in #{plugin_name}") caps_registry = @capabilities[plugin_name.to_sym] has_cap = caps_registry.key?(cap_name.to_sym) @@ -93,6 +84,10 @@ module VagrantPlugins caps_registry = capabilities[plugin_name] target_cap = caps_registry.get(cap_name) + if target_cap.nil? + raise "Failed to locate requested capability `#{cap_name.inspect}' on plugin #{plugin_name}" + end + args = mapper.funcspec_map( req.func_args, expect: default_args.keys + [Types::Direct] diff --git a/plugins/commands/serve/service/command_service.rb b/plugins/commands/serve/service/command_service.rb index eb93b9e0d..777e90d56 100644 --- a/plugins/commands/serve/service/command_service.rb +++ b/plugins/commands/serve/service/command_service.rb @@ -5,6 +5,7 @@ module VagrantPlugins module Service class CommandService < SDK::CommandService::Service include Util::ServiceInfo + include Util::HasSeeds::Service prepend Util::HasMapper prepend Util::HasBroker diff --git a/plugins/commands/serve/service/provider_service.rb b/plugins/commands/serve/service/provider_service.rb index 59c34eb93..405d864c0 100644 --- a/plugins/commands/serve/service/provider_service.rb +++ b/plugins/commands/serve/service/provider_service.rb @@ -7,6 +7,7 @@ module VagrantPlugins module Service class ProviderService < SDK::ProviderService::Service include Util::ServiceInfo + include Util::HasSeeds::Service prepend Util::HasMapper prepend Util::HasBroker