From 2b5bd64ec8bb8f6379b3644d937f017bb32e43ce Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Fri, 18 Feb 2022 16:51:01 -0800 Subject: [PATCH] Remove local provider injection to machine --- plugins/commands/serve/service/provider_service.rb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/plugins/commands/serve/service/provider_service.rb b/plugins/commands/serve/service/provider_service.rb index 4b30500f3..4f1ad3c15 100644 --- a/plugins/commands/serve/service/provider_service.rb +++ b/plugins/commands/serve/service/provider_service.rb @@ -58,18 +58,7 @@ module VagrantPlugins ) options = Type::Options.new(value: {}) if options.nil? - provider = plugin.new(machine) - - # Within Ruby, many actions are defined inside provider plugins, - # and within their implementations they assume that - # `machine.provider` yields an instance of their provider. A common - # instance of this assumption would be a call like - # `machine.provider.driver.some_implementation_specific_method`. - # - # Because these assumptions are rampant within the Ruby - # implementations of providers, we break encapsulation here to set - # the local copy of the provider plugin on the machine. - machine.instance_variable_set(:@provider, provider) + provider = load_provider(plugin, machine) callable = provider.action(action_name) if callable.nil?