Sha256: 8044317e35a59bb4a2fed95cab9cb5f2378975eaa4672842e2791bf446f827b8
Contents?: true
Size: 566 Bytes
Versions: 13
Compression:
Stored size: 566 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
13 entries across 13 versions & 1 rubygems