Sha256: 337f5902e3dc9a5d6bf300511630195976b6a7e15d0965c14cb25e03085e9337
Contents?: true
Size: 876 Bytes
Versions: 14
Compression:
Stored size: 876 Bytes
Contents
module Vagrant module Actions module VM class Export < Base attr_reader :temp_dir def execute! setup_temp_dir export end def cleanup if temp_dir logger.info "Removing temporary export directory..." FileUtils.rm_r(temp_dir) end end def rescue(exception) cleanup end def setup_temp_dir @temp_dir = File.join(Env.tmp_path, Time.now.to_i.to_s) logger.info "Creating temporary directory for export..." FileUtils.mkpath(temp_dir) end def ovf_path File.join(temp_dir, Vagrant.config.vm.box_ovf) end def export logger.info "Exporting VM to #{ovf_path} ..." @runner.vm.export(ovf_path, {}, true) end end end end end
Version data entries
14 entries across 14 versions & 2 rubygems