Sha256: b16ea19c14efacd297ff8f5098225f4e677363489e05598b07a0ef1d3f261763

Contents?: true

Size: 531 Bytes

Versions: 6

Compression:

Stored size: 531 Bytes

Contents

module Vagrant
  module LXC
    module Action
      class ForcedHalt
        def initialize(app, env)
          @app = app
        end

        def call(env)
          if env[:machine].provider.state.running?
            env[:ui].info I18n.t("vagrant.actions.vm.halt.force")
            # TODO: Container#halt is kinda graceful as well, if it doesn't
            #       work we can issue a lxc-stop.
            env[:machine].provider.container.halt
          end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vagrant-lxc-0.2.0 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-0.1.1 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-0.1.0 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-0.0.3 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-0.0.2 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-0.0.1 lib/vagrant-lxc/action/forced_halt.rb