lib/vagrant/environment.rb
# Loads this environment's configuration and stores it in the {#config}
# variable. The configuration loaded by this method is specified to
# this environment, meaning that it will use the given root directory
# to load the Vagrantfile into that context.
Loads this environment's configuration and stores it in the {#config}
variable. The configuration loaded by this method is specified to
this environment, meaning that it will use the given root directory
to load the Vagrantfile into that context.
Loads this environment ' s configuration and stores it in the { #config } variable . The configuration loaded by this method is specified to this environment meaning that it will use the given root directory to load the Vagrantfile into that context .
def load_config!
      first_run = @config.nil?
      @config_loader ||= Config.new(parent ? parent.config_loader : nil)
      @config_loader.load_order = [:default, :box, :home, :root, :sub_vm]
      @config_loader.set(:default, File.expand_path("config/default.rb", Vagrant.source_root))
      @config_loader.set(:box, File.join(box.directory, ROOTFILE_NAME)) if !first_run && vm && box
      @config_loader.set(:home, File.join(home_path, ROOTFILE_NAME)) if !first_run && home_path
      @config_loader.set(:root, File.join(root_path, ROOTFILE_NAME)) if root_path
      if vm
        subvm = parent.config.vm.defined_vms[vm.name]
        @config_loader.set(:sub_vm, subvm.proc_stack) if subvm
      end
      @config = @config_loader.load(self)
      @logger = nil
      if first_run
        load_home_directory!
        load_config!
      end
    end
def load_config! first_run = @config . nil? @config_loader ||= Config . new ( parent ? parent . config_loader : nil ) @config_loader . load_order = [ :default , :box , :home , :root , :sub_vm ] @config_loader . set ( :default , File . expand_path ( "config/default.rb" , Vagrant . source_root ) ) @config_loader . set ( :box , File . join ( box . directory , ROOTFILE_NAME ) ) if ! first_run && vm && box @config_loader . set ( :home , File . join ( home_path , ROOTFILE_NAME ) ) if ! first_run && home_path @config_loader . set ( :root , File . join ( root_path , ROOTFILE_NAME ) ) if root_path if vm subvm = parent . config . vm . defined_vms [ vm . name ] @config_loader . set ( :sub_vm , subvm . proc_stack ) if subvm end @config = @config_loader . load ( self ) @logger = nil if first_run load_home_directory! load_config! end end
Loads this environment's configuration and stores it in the {#config}
variable.
Loads this environment ' s configuration and stores it in the { #config } variable .
# First load the initial, non config-dependent Vagrantfiles # If this environment is representing a sub-VM, then we push that # proc on as the last configuration. # Execute the configuration stack and store the result as the final # value in the config ivar. # (re)load the logger # After the first run we want to load the configuration again since # it can change due to box Vagrantfiles and home directory Vagrantfiles