Sha256: 2f88cc9fe0017e43d33b86df0457ccdbddc9a13139493fde61ae0e0e377b9f71

Contents?: true

Size: 421 Bytes

Versions: 28

Compression:

Stored size: 421 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.id == :running
            env[:ui].info I18n.t("vagrant_lxc.messages.force_shutdown")
            env[:machine].provider.driver.forced_halt
          end

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

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
vagrant-lxc-1.4.3 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-1.4.2 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-1.4.1 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-2.1-patch-1.4.0 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-1.4.0 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-1.3.1 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-1.3.0 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-1.2.4 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-1.2.3 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-1.2.2 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-1.2.1 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-1.2.0 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-1.1.0 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-1.0.1 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-1.0.0 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-1.0.0.alpha.3 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-1.0.0.alpha.2 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-1.0.0.alpha.1 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-0.8.0 lib/vagrant-lxc/action/forced_halt.rb
vagrant-lxc-0.7.0 lib/vagrant-lxc/action/forced_halt.rb