vagrant/plugins/providers/hyperv/config.rb

43 lines
898 B
Ruby
Raw Normal View History

require "vagrant"
require_relative "host_share/config"
2014-02-15 23:38:11 +00:00
module VagrantPlugins
module HyperV
class Config < Vagrant.plugin("2", :config)
2014-02-26 19:12:24 +00:00
# The timeout to wait for an IP address when booting the machine,
# in seconds.
#
2014-02-26 19:12:24 +00:00
# @return [Integer]
attr_accessor :ip_address_timeout
2014-02-15 23:38:11 +00:00
2014-02-26 19:12:24 +00:00
attr_reader :host_share
2014-02-26 19:12:24 +00:00
def initialize
@ip_address_timeout = UNSET_VALUE
@host_share = HostShare::Config.new
end
2014-02-26 19:12:24 +00:00
def host_config(&block)
block.call(@host_share)
end
def finalize!
2014-02-26 19:12:24 +00:00
if @ip_address_timeout == UNSET_VALUE
@ip_address_timeout = 120
end
end
def validate(machine)
errors = _detected_errors
=begin
unless host_share.valid_config?
errors << host_share.errors.flatten.join(" ")
end
=end
{ "HyperV" => errors }
end
end
end
end