Sha256: 6f4897da0bc072105916f11e16a3bef5855451c8435e93d99f92af4f0adc66d9

Contents?: true

Size: 1016 Bytes

Versions: 12

Compression:

Stored size: 1016 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].rewriting do |ui|
              ui.clear_line
              ui.report_progress(progress.percent, 100, false)
            end
          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

12 entries across 12 versions & 3 rubygems

Version Path
vagrant-unbundled-2.3.6.0 plugins/providers/hyperv/action/export.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.3.3.0 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.3.2.0 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.2.19.0 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.2.18.0 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.2.16.0 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.2.14.0 plugins/providers/hyperv/action/export.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.2.10.0 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.2.9.0 plugins/providers/hyperv/action/export.rb
vagrant-unbundled-2.2.8.0 plugins/providers/hyperv/action/export.rb