2012-07-15 18:17:58 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module ProviderVirtualBox
|
|
|
|
class Provider < Vagrant.plugin("1", :provider)
|
2012-07-25 04:32:38 +00:00
|
|
|
def initialize(machine)
|
|
|
|
@machine = machine
|
|
|
|
@driver = Driver::Meta.new(@machine.id)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Return the state of VirtualBox virtual machine by actually
|
|
|
|
# querying VBoxManage.
|
|
|
|
def state
|
|
|
|
return :not_created if !@driver.uuid
|
|
|
|
state = @driver.read_state
|
|
|
|
return :unknown if !state
|
|
|
|
state
|
|
|
|
end
|
2012-07-15 18:17:58 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|