Sha256: ba62e37e5fe1e6934cbe16f90d40ad2b285aa9bf93d87ea74cdaec726cb3f71d

Contents?: true

Size: 970 Bytes

Versions: 17

Compression:

Stored size: 970 Bytes

Contents

require "fileutils"

module VagrantPlugins
  module HyperV
    module Action
      class Export
        def initialize(app, env)
          @app = app
        end

        def call(env)
          @env = env

          @env[:ui].info @env[:machine].state.id.to_s

          raise Vagrant::Errors::VMPowerOffToPackage if
            @env[:machine].state.id != :off

          export

          @app.call(env)
        end

        def export
          @env[:ui].info I18n.t("vagrant.actions.vm.export.exporting")
          export_tmp_dir = Vagrant::Util::Platform.wsl_to_windows_path(@env["export.temp_dir"])
          @env[:machine].provider.driver.export(export_tmp_dir) do |progress|
            @env[:ui].clear_line
            @env[:ui].report_progress(progress.percent, 100, false)
          end

          # Clear the line a final time so the next data can appear
          # alone on the line.
          @env[:ui].clear_line
        end

      end
    end
  end
end

Version data entries

17 entries across 13 versions & 2 rubygems

Version Path
vagrant-unbundled-2.2.7.0 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.2.6.2 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.2.6.1 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.2.6.0 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.2.5.0 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.2.4.0 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.2.3.0 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.2.2.0 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.2.0.0 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.1.4.0 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.1.2.0 plugins/providers/hyperv/action/export.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/plugins/providers/hyperv/action/export.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/plugins/providers/hyperv/action/export.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/plugins/providers/hyperv/action/export.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/plugins/providers/hyperv/action/export.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/plugins/providers/hyperv/action/export.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/plugins/providers/hyperv/action/export.rb