From 1ccedcd2cb8520f514eddf2d3b0c55b982cee851 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 6 Mar 2014 08:58:31 -0800 Subject: [PATCH] providers/hyperv: update driver stuff --- plugins/providers/hyperv/driver.rb | 8 ++++---- plugins/providers/hyperv/provider.rb | 10 ++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/plugins/providers/hyperv/driver.rb b/plugins/providers/hyperv/driver.rb index 277a53266..9f11881e6 100644 --- a/plugins/providers/hyperv/driver.rb +++ b/plugins/providers/hyperv/driver.rb @@ -9,11 +9,11 @@ module VagrantPlugins class Driver ERROR_REGEXP = /===Begin-Error===(.+?)===End-Error===/m OUTPUT_REGEXP = /===Begin-Output===(.+?)===End-Output===/m - attr_reader :vm_id, :machine - def initialize(machine) - @vm_id = machine.id - @machine = machine + attr_reader :vm_id + + def initialize(id) + @vm_id = id end def execute(path, options) diff --git a/plugins/providers/hyperv/provider.rb b/plugins/providers/hyperv/provider.rb index 54a459666..de0453e20 100644 --- a/plugins/providers/hyperv/provider.rb +++ b/plugins/providers/hyperv/provider.rb @@ -31,12 +31,6 @@ module VagrantPlugins machine_id_changed end - # If the machine ID changed, then we need to rebuild our underlying - # driver. - def machine_id_changed - @driver = Driver.new(@machine) - end - def action(name) # Attempt to get the action method from the Action class if it # exists, otherwise return nil to show that we don't support the @@ -46,6 +40,10 @@ module VagrantPlugins nil end + def machine_id_changed + @driver = Driver.new(@machine.id) + end + def state state_id = nil state_id = :not_created if !@machine.id