diff --git a/plugins/commands/serve/service/command_service.rb b/plugins/commands/serve/service/command_service.rb index e3b99be63..fe450f6e0 100644 --- a/plugins/commands/serve/service/command_service.rb +++ b/plugins/commands/serve/service/command_service.rb @@ -54,12 +54,13 @@ module VagrantPlugins with_info(ctx) do |info| plugin_name = info.plugin_name - ui_client, env_client, arguments = mapper.funcspec_map(req.spec) + ui, env, arguments = mapper.funcspec_map(req.spec, expect: [Vagrant::UI::Remote, Vagrant::Environment, SDK::Command::Arguments]) - ui = Vagrant::UI::Remote.new(ui_client) - env = Vagrant::Environment.new( - {ui: ui, client: env_client} - ) + + # ui = Vagrant::UI::Remote.new(ui_client) + # env = Vagrant::Environment.new( + # {ui: ui, client: env_client} + # ) plugin = Vagrant::Plugin::V2::Plugin.manager.commands[plugin_name.to_sym].to_a.first if !plugin diff --git a/plugins/commands/serve/service/guest_service.rb b/plugins/commands/serve/service/guest_service.rb index 7940ac0c0..c087d1c10 100644 --- a/plugins/commands/serve/service/guest_service.rb +++ b/plugins/commands/serve/service/guest_service.rb @@ -40,7 +40,7 @@ module VagrantPlugins def detect(req, ctx) with_info(ctx) do |info| plugin_name = info.plugin_name - target = mapper.funcspec_map(req) + target = mapper.funcspec_map(req, expect: Client::Target) project = target.project env = Vagrant::Environment.new({client: project}) machine = env.machine(target.name.to_sym, target.provider_name.to_sym) diff --git a/plugins/commands/serve/service/host_service.rb b/plugins/commands/serve/service/host_service.rb index d2e5a9439..b9b9bd5be 100644 --- a/plugins/commands/serve/service/host_service.rb +++ b/plugins/commands/serve/service/host_service.rb @@ -39,7 +39,7 @@ module VagrantPlugins def detect(req, ctx) with_info(ctx) do |info| plugin_name = info.plugin_name - statebag = mapper.funcspec_map(req) + statebag = mapper.funcspec_map(req, expect: Client::StateBag) plugin = Vagrant.plugin("2").manager.hosts[plugin_name.to_s.to_sym].to_a.first if !plugin raise "Failed to locate host plugin for: #{plugin_name.inspect}" diff --git a/plugins/commands/serve/service/provider_service.rb b/plugins/commands/serve/service/provider_service.rb index 01c98eef7..59c34eb93 100644 --- a/plugins/commands/serve/service/provider_service.rb +++ b/plugins/commands/serve/service/provider_service.rb @@ -40,7 +40,7 @@ module VagrantPlugins def action_up(req, ctx) with_info(ctx) do |info| plugin_name = info.plugin_name - ui, machine = mapper.funcspec_map(req.spec) + ui, machine = mapper.funcspec_map(req.spec, expect: [Vagrant::UI::Remote, Vagrant::Machine]) machine = Client::Target::Machine.load(raw_machine, ui) machine.ui.warn("hello from vagrant")