core: MachineIndex keeps track of Vagrantfile name

This commit is contained in:
Mitchell Hashimoto 2014-04-14 20:08:17 -07:00
parent 09ff31e3a3
commit a4addd0e25
2 changed files with 8 additions and 0 deletions

View File

@ -236,6 +236,7 @@ module Vagrant
entry.provider = @provider_name.to_s
entry.state = "preparing"
entry.vagrantfile_path = @env.root_path
entry.vagrantfile_name = @env.vagrantfile_name
entry = @env.machine_index.set(entry)
@env.machine_index.release(entry)

View File

@ -339,6 +339,11 @@ module Vagrant
# @return [String]
attr_accessor :state
# The valid Vagrantfile filenames for this environment.
#
# @return [Array<String>]
attr_accessor :vagrantfile_name
# The path to the Vagrantfile that manages this machine.
#
# @return [Pathname]
@ -367,6 +372,7 @@ module Vagrant
@name = raw["name"]
@provider = raw["provider"]
@state = raw["state"]
@vagrantfile_name = raw["vagrantfile_name"]
@vagrantfile_path = Pathname.new(raw["vagrantfile_path"])
# TODO(mitchellh): parse into a proper datetime
@updated_at = raw["updated_at"]
@ -379,6 +385,7 @@ module Vagrant
"name" => @name,
"provider" => @provider,
"state" => @state,
"vagrantfile_name" => @vagrantfile_name,
"vagrantfile_path" => @vagrantfile_path,
"updated_at" => @updated_at,
"extra_data" => @extra_data,