Sha256: 0e5a631ac36871170ee5e67a3f0f97072e0b1381921690dc7274851dcbe634b3

Contents?: true

Size: 433 Bytes

Versions: 2

Compression:

Stored size: 433 Bytes

Contents

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vagrant-cloudstack-1.3.0 lib/vagrant-cloudstack/action/is_stopped.rb
vagrant-cloudstack-1.2.0 lib/vagrant-cloudstack/action/is_stopped.rb