Sha256: 9f0df6b885cb4adff5eae24745fbbbaf6c5cb3f55557c7febf64a46d3f085f65

Contents?: true

Size: 456 Bytes

Versions: 23

Compression:

Stored size: 456 Bytes

Contents

# frozen_string_literal: true

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

        def call(env)
          env[:result] = env[:machine].state.id != :not_created
          @app.call(env)
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
vagrant-libvirt-0.12.2 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.12.1 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.12.0 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.11.2 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.11.1 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.10.8 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.10.7 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.10.6 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.10.5 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.10.4 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.10.3 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.10.2 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.10.1 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.10.0 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.9.0 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.8.2 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.8.1 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.8.0 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.7.0 lib/vagrant-libvirt/action/is_created.rb
vagrant-libvirt-0.6.3 lib/vagrant-libvirt/action/is_created.rb