Sha256: 6b98aa3879caeb5252180893984baf5976dc1aafe6206e30291f4a57e1ac8f40

Contents?: true

Size: 1.2 KB

Versions: 10

Compression:

Stored size: 1.2 KB

Contents

module Vagrant
  module Actions
    module VM
      class Up < Base
        def prepare
          # If the dotfile is not a file, raise error
          if File.exist?(@runner.env.dotfile_path) && !File.file?(@runner.env.dotfile_path)
            raise ActionException.new(:dotfile_error, :env => @runner.env)
          end

          # Up is a "meta-action" so it really just queues up a bunch
          # of other actions in its place:
          steps = [Import, Customize, ForwardPorts, SharedFolders, Boot]
          steps << Provision if !@runner.env.config.vm.provisioner.nil?
          steps.insert(0, MoveHardDrive) if @runner.env.config.vm.hd_location

          steps.each do |action_klass|
            @runner.add_action(action_klass)
          end
        end

        def after_import
          persist
          setup_mac_address
        end

        def persist
          logger.info "Persisting the VM UUID (#{@runner.uuid})..."
          @runner.env.persist_vm
        end

        def setup_mac_address
          logger.info "Matching MAC addresses..."
          @runner.vm.network_adapters.first.mac_address = @runner.env.config.vm.base_mac
          @runner.vm.save
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
vagrantup-0.3.4 lib/vagrant/actions/vm/up.rb
vagrantup-0.3.3 lib/vagrant/actions/vm/up.rb
vagrantup-0.3.2 lib/vagrant/actions/vm/up.rb
vagrantup-0.3.1 lib/vagrant/actions/vm/up.rb
vagrantup-0.3.0 lib/vagrant/actions/vm/up.rb
vagrant-0.3.4 lib/vagrant/actions/vm/up.rb
vagrant-0.3.3 lib/vagrant/actions/vm/up.rb
vagrant-0.3.2 lib/vagrant/actions/vm/up.rb
vagrant-0.3.1 lib/vagrant/actions/vm/up.rb
vagrant-0.3.0 lib/vagrant/actions/vm/up.rb