Sha256: 65f2339297f02dcf0153d4d74f2ebadecdb15f578593dd92c749ded735093b4c
Contents?: true
Size: 641 Bytes
Versions: 12
Compression:
Stored size: 641 Bytes
Contents
require "log4r" module VagrantPlugins module G5K 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 @logger = Log4r::Logger.new("vagrant_g5k::action::is_created") end def call(env) machine_state_id = env[:machine].state.id @logger.info "machine is in state #{machine_state_id}" env[:result] = machine_state_id == :Running or machine_state_id == :Waiting @app.call(env) end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems