Sha256: 54bbdefc2724c5a75791d4dda77510dfc26c17001146a5bed9f61b79b87e64a7

Contents?: true

Size: 469 Bytes

Versions: 8

Compression:

Stored size: 469 Bytes

Contents

module Vagrant
  class Action
    module VM
      # Discards the saved state of the VM if its saved. If its
      # not saved, does nothing.
      class DiscardState
        def initialize(app, env)
          @app = app
        end

        def call(env)
          if env["vm"].vm.saved?
            env.logger.info "Discarding saved state of VM..."
            env["vm"].vm.discard_state
          end

          @app.call(env)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
vagrantup-0.5.4 lib/vagrant/action/vm/discard_state.rb
vagrantup-0.5.3 lib/vagrant/action/vm/discard_state.rb
vagrantup-0.5.2 lib/vagrant/action/vm/discard_state.rb
vagrantup-0.5.1 lib/vagrant/action/vm/discard_state.rb
vagrant-0.5.4 lib/vagrant/action/vm/discard_state.rb
vagrant-0.5.3 lib/vagrant/action/vm/discard_state.rb
vagrant-0.5.2 lib/vagrant/action/vm/discard_state.rb
vagrant-0.5.1 lib/vagrant/action/vm/discard_state.rb