Remove local provider injection to machine
This commit is contained in:
parent
ab8dee7a72
commit
2b5bd64ec8
@ -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?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user