Sha256: 4b0e3e53975d7ec482ff0052d0687224384f09a521467a8460fca100160b10c3

Contents?: true

Size: 415 Bytes

Versions: 2

Compression:

Stored size: 415 Bytes

Contents

module VagrantPlugins
  module GANETI
    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

2 entries across 2 versions & 1 rubygems

Version Path
vagrant-ganeti-0.1.1 lib/vagrant-ganeti/action/is_created.rb
vagrant-ganeti-0.0.1 lib/vagrant-plugin-ganeti/action/is_created.rb