Sha256: cc74c4edcc81e5c59d897a131e751f2c0a26a40556dfbb4b9275e2a64fbc4db6
Contents?: true
Size: 567 Bytes
Versions: 5
Compression:
Stored size: 567 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) domain = env[:machine].provider.driver.connection.servers.get(env[:machine].id.to_s) raise Errors::NoDomainError if domain == nil env[:result] = domain.state.to_s == 'running' @app.call(env) end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems