Sha256: f3d9d846078f1307a605b0dbecdf6afc400d121fe28366739ae9df56af81696a
Contents?: true
Size: 645 Bytes
Versions: 23
Compression:
Stored size: 645 Bytes
Contents
# frozen_string_literal: true require 'log4r' module VagrantPlugins module ProviderLibvirt module Action # Halt the domain. class HaltDomain def initialize(app, _env) @logger = Log4r::Logger.new('vagrant_libvirt::action::halt_domain') @app = app end def call(env) domain = env[:machine].provider.driver.connection.servers.get(env[:machine].id.to_s) if env[:machine].state.id == :running env[:ui].info(I18n.t('vagrant_libvirt.halt_domain')) domain.poweroff end @app.call(env) end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems