Sha256: 5332c42c93978db7b34f110f93a389fc8aa1e0d8f16ec7ccf19afe4615e5c53c
Contents?: true
Size: 956 Bytes
Versions: 4
Compression:
Stored size: 956 Bytes
Contents
require 'log4r' module VagrantPlugins module ProviderLibvirt module Action # Resume suspended domain. class ResumeDomain def initialize(app, env) @logger = Log4r::Logger.new("vagrant_libvirt::action::resume_domain") @app = app end def call(env) env[:ui].info(I18n.t("vagrant_libvirt.resuming_domain")) domain = env[:machine].provider.driver.connection.servers.get(env[:machine].id.to_s) raise Errors::NoDomainError if domain == nil libvirt_domain = env[:machine].provider.driver.connection.client.lookup_domain_by_uuid(env[:machine].id) config = env[:machine].provider_config if config.suspend_mode == 'managedsave' domain.start else domain.resume end @logger.info("Machine #{env[:machine].id} is resumed.") @app.call(env) end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems