lib/vagrant/machine_index.rb in vagrant-unbundled-2.2.19.0 vs lib/vagrant/machine_index.rb in vagrant-unbundled-2.3.2.0
- old
+ new
@@ -34,10 +34,12 @@
# }
# }
# }
#
class MachineIndex
+ autoload :Remote, "vagrant/machine_index/remote"
+
include Enumerable
# Initializes a MachineIndex at the given file location.
#
# @param [Pathname] data_dir Path to the directory where data for the
@@ -351,10 +353,12 @@
end
end
# An entry in the MachineIndex.
class Entry
+ autoload :Remote, "vagrant/machine_index/remote"
+
# The unique ID for this entry. This is _not_ the ID for the
# machine itself (which is provider-specific and in the data directory).
#
# @return [String]
attr_reader :id
@@ -377,10 +381,15 @@
# The last known state of this machine.
#
# @return [String]
attr_accessor :state
+ # The last known state of this machine.
+ #
+ # @return [MachineState]
+ attr_accessor :full_state
+
# The valid Vagrantfile filenames for this environment.
#
# @return [Array<String>]
attr_accessor :vagrantfile_name
@@ -403,19 +412,21 @@
# Initializes an entry.
#
# The parameter given should be nil if this is being created
# publicly.
def initialize(id=nil, raw=nil)
- @extra_data = {}
+ @logger = Log4r::Logger.new("vagrant::machine_index::entry")
+ @extra_data = {}
+ @id = id
# Do nothing if we aren't given a raw value. Otherwise, parse it.
return if !raw
- @id = id
@local_data_path = raw["local_data_path"]
@name = raw["name"]
@provider = raw["provider"]
@state = raw["state"]
+ @full_state = raw["full_state"]
@vagrantfile_name = raw["vagrantfile_name"]
@vagrantfile_path = raw["vagrantfile_path"]
# TODO(mitchellh): parse into a proper datetime
@updated_at = raw["updated_at"]
@extra_data = raw["extra_data"] || {}