class VagrantPlugins::ProviderLibvirt::Action::IsRunning
This can be used with “Call” built-in to check if the machine is running and branch in the middleware.
Public Class Methods
Source
# File lib/vagrant-libvirt/action/is_running.rb, line 9 def initialize(app, _env) @app = app end
Public Instance Methods
Source
# File lib/vagrant-libvirt/action/is_running.rb, line 13 def call(env) env[:result] = env[:machine].state.id == :running @app.call(env) end