Sha256: 7585f2c88632acd38bfd56ad9cd69d67806b20359a7dd5e38b599155a0df263e

Contents?: true

Size: 422 Bytes

Versions: 4

Compression:

Stored size: 422 Bytes

Contents

module VagrantPlugins
  module ProviderLibvirt
    module Action
      # This can be used with "Call" built-in to check if the machine
      # is running and branch in the middleware.
      class IsRunning
        def initialize(app, _env)
          @app = app
        end

        def call(env)
          env[:result] = env[:machine].state.id == :running

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vagrant-libvirt-0.5.3 lib/vagrant-libvirt/action/is_running.rb
vagrant-libvirt-0.5.2 lib/vagrant-libvirt/action/is_running.rb
vagrant-libvirt-0.5.1 lib/vagrant-libvirt/action/is_running.rb
vagrant-libvirt-0.5.0 lib/vagrant-libvirt/action/is_running.rb