Sha256: 9fbbbdd04dac0eae5b6a9a6c96eb530102d05d154b692fa2642873cc9b266bc0

Contents?: true

Size: 658 Bytes

Versions: 14

Compression:

Stored size: 658 Bytes

Contents

module Vagrant
  module LXC
    module Action
      class RemoveTemporaryFiles
        def initialize(app, env)
          @app    = app
          @logger = Log4r::Logger.new("vagrant::lxc::action::remove_tmp_files")
        end

        def call(env)
          # Continue execution, we need the container to be stopped
          @app.call env

          if env[:machine].state.id == :stopped
            @logger.debug 'Removing temporary files'
            tmp_path = env[:machine].provider.driver.rootfs_path.join('tmp')
            env[:machine].provider.sudo_wrapper.run('rm', '-rf', "#{tmp_path}/*")
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
vagrant-lxc-1.1.0 lib/vagrant-lxc/action/remove_temporary_files.rb
vagrant-lxc-1.0.1 lib/vagrant-lxc/action/remove_temporary_files.rb
vagrant-lxc-1.0.0 lib/vagrant-lxc/action/remove_temporary_files.rb
vagrant-lxc-1.0.0.alpha.3 lib/vagrant-lxc/action/remove_temporary_files.rb
vagrant-lxc-1.0.0.alpha.2 lib/vagrant-lxc/action/remove_temporary_files.rb
vagrant-lxc-1.0.0.alpha.1 lib/vagrant-lxc/action/remove_temporary_files.rb
vagrant-lxc-0.8.0 lib/vagrant-lxc/action/remove_temporary_files.rb
vagrant-lxc-0.7.0 lib/vagrant-lxc/action/remove_temporary_files.rb
vagrant-lxc-0.6.4 lib/vagrant-lxc/action/remove_temporary_files.rb
vagrant-lxc-0.6.3 lib/vagrant-lxc/action/remove_temporary_files.rb
vagrant-lxc-0.6.2 lib/vagrant-lxc/action/remove_temporary_files.rb
vagrant-lxc-0.6.1 lib/vagrant-lxc/action/remove_temporary_files.rb
vagrant-lxc-0.6.0 lib/vagrant-lxc/action/remove_temporary_files.rb
vagrant-lxc-0.5.0 lib/vagrant-lxc/action/remove_temporary_files.rb