providers/hyperv: update driver stuff

This commit is contained in:
Mitchell Hashimoto 2014-03-06 08:58:31 -08:00
parent d1dc010073
commit 1ccedcd2cb
2 changed files with 8 additions and 10 deletions

View File

@ -9,11 +9,11 @@ module VagrantPlugins
class Driver class Driver
ERROR_REGEXP = /===Begin-Error===(.+?)===End-Error===/m ERROR_REGEXP = /===Begin-Error===(.+?)===End-Error===/m
OUTPUT_REGEXP = /===Begin-Output===(.+?)===End-Output===/m OUTPUT_REGEXP = /===Begin-Output===(.+?)===End-Output===/m
attr_reader :vm_id, :machine
def initialize(machine) attr_reader :vm_id
@vm_id = machine.id
@machine = machine def initialize(id)
@vm_id = id
end end
def execute(path, options) def execute(path, options)

View File

@ -31,12 +31,6 @@ module VagrantPlugins
machine_id_changed machine_id_changed
end 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) def action(name)
# Attempt to get the action method from the Action class if it # Attempt to get the action method from the Action class if it
# exists, otherwise return nil to show that we don't support the # exists, otherwise return nil to show that we don't support the
@ -46,6 +40,10 @@ module VagrantPlugins
nil nil
end end
def machine_id_changed
@driver = Driver.new(@machine.id)
end
def state def state
state_id = nil state_id = nil
state_id = :not_created if !@machine.id state_id = :not_created if !@machine.id