repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/spec/unit/action/resume_domain_spec.rb | spec/unit/action/resume_domain_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require 'vagrant-libvirt/action/resume_domain'
describe VagrantPlugins::ProviderLibvirt::Action::ResumeDomain do
subject { described_class.new(app, env) }
include_context 'unit'
include_context 'libvirt'
let(:driver) { instance_double(::Va... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/spec/unit/action/shutdown_domain_spec.rb | spec/unit/action/shutdown_domain_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require 'vagrant-libvirt/action/shutdown_domain'
describe VagrantPlugins::ProviderLibvirt::Action::StartShutdownTimer do
subject { described_class.new(app, env) }
include_context 'unit'
describe '#call' do
it 'should set shutdown_start_ti... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/spec/unit/action/remove_libvirt_image_spec.rb | spec/unit/action/remove_libvirt_image_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require 'vagrant-libvirt/action/remove_libvirt_image'
describe VagrantPlugins::ProviderLibvirt::Action::RemoveLibvirtImage do
subject { described_class.new(app, env) }
include_context 'unit'
let(:box) { instance_double(::Vagrant::Box) }
de... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/spec/unit/action/forward_ports_spec.rb | spec/unit/action/forward_ports_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require 'vagrant-libvirt/errors'
require 'vagrant-libvirt/action/forward_ports'
describe VagrantPlugins::ProviderLibvirt::Action::ForwardPorts do
subject { described_class.new(app, env) }
include_context 'unit'
let(:machine_config) { double("... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/spec/unit/action/create_network_interfaces.rb | spec/unit/action/create_network_interfaces.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require 'vagrant-libvirt/errors'
require 'vagrant-libvirt/action/create_network_interfaces'
require 'vagrant-libvirt/util/unindent'
describe VagrantPlugins::ProviderLibvirt::Action::CreateNetworkInterfaces do
subject { described_class.new(app, env)... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/spec/unit/action/cleanup_on_failure_spec.rb | spec/unit/action/cleanup_on_failure_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require 'vagrant/action/runner'
require 'vagrant-libvirt/action'
require 'vagrant-libvirt/action/cleanup_on_failure'
describe VagrantPlugins::ProviderLibvirt::Action::CleanupOnFailure do
subject { described_class }
let(:callable_error) do
C... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/spec/unit/action/prepare_nfs_settings_spec.rb | spec/unit/action/prepare_nfs_settings_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require 'vagrant-libvirt/action/prepare_nfs_settings'
describe VagrantPlugins::ProviderLibvirt::Action::PrepareNFSSettings do
subject { described_class.new(app, env) }
include_context 'unit'
describe '#call' do
before do
# avoid re... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/spec/unit/action/handle_box_image_spec.rb | spec/unit/action/handle_box_image_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require 'json'
require 'vagrant-libvirt/action/handle_box_image'
require 'vagrant-libvirt/util/byte_number'
describe VagrantPlugins::ProviderLibvirt::Action::HandleBoxImage do
subject { described_class.new(app, env) }
include_context 'unit'
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/spec/unit/action/halt_domain_spec.rb | spec/unit/action/halt_domain_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require 'vagrant-libvirt/action/halt_domain'
describe VagrantPlugins::ProviderLibvirt::Action::HaltDomain do
subject { described_class.new(app, env) }
include_context 'unit'
include_context 'libvirt'
let(:driver) { double('driver') }
let(... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/spec/unit/action/set_name_of_domain_spec.rb | spec/unit/action/set_name_of_domain_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require 'vagrant-libvirt/action/set_name_of_domain'
describe VagrantPlugins::ProviderLibvirt::Action::SetNameOfDomain do
before :each do
@env = EnvironmentHelper.new
end
it 'builds unique domain name' do
@env.random_hostname = true
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/spec/unit/action/create_domain_volume_spec.rb | spec/unit/action/create_domain_volume_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require 'fog/libvirt/models/compute/volume'
require 'vagrant-libvirt/action/create_domain_volume'
require 'vagrant-libvirt/util/byte_number'
describe VagrantPlugins::ProviderLibvirt::Action::CreateDomainVolume do
subject { described_class.new(app... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/spec/unit/action/start_domain_spec.rb | spec/unit/action/start_domain_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require 'vagrant-libvirt/errors'
require 'vagrant-libvirt/action/start_domain'
require 'vagrant-libvirt/util/unindent'
describe VagrantPlugins::ProviderLibvirt::Action::StartDomain do
subject { described_class.new(app, env) }
include_context 'un... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/spec/unit/action/wait_till_up_spec.rb | spec/unit/action/wait_till_up_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require 'vagrant-libvirt/action/wait_till_up'
require 'vagrant-libvirt/errors'
describe VagrantPlugins::ProviderLibvirt::Action::WaitTillUp do
subject { described_class.new(app, env) }
include_context 'vagrant-unit'
include_context 'libvirt'
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/spec/unit/templates/domain_spec.rb | spec/unit/templates/domain_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require 'vagrant-libvirt/config'
require 'vagrant-libvirt/util/erb_template'
describe 'templates/domain' do
include_context 'unit'
class DomainTemplateHelper < VagrantPlugins::ProviderLibvirt::Config
include VagrantPlugins::ProviderLibvirt::... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt.rb | lib/vagrant-libvirt.rb | # frozen_string_literal: true
require 'pathname'
module VagrantPlugins
module ProviderLibvirt
lib_path = Pathname.new(File.expand_path('../vagrant-libvirt', __FILE__))
autoload :Action, lib_path.join('action')
autoload :Errors, lib_path.join('errors')
autoload :Util, lib_path.join('util')
def s... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/provider.rb | lib/vagrant-libvirt/provider.rb | # frozen_string_literal: true
require 'vagrant'
module VagrantPlugins
module ProviderLibvirt
autoload :Driver, 'vagrant-libvirt/driver'
# This is the base class for a provider for the V2 API. A provider
# is responsible for creating compute resources to match the
# needs of a Vagrant-configured sys... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/version.rb | lib/vagrant-libvirt/version.rb | # frozen_string_literal: true
require 'open3'
require 'tmpdir'
module VagrantPlugins
module ProviderLibvirt
VERSION_FILE = File.dirname(__FILE__) + "/version"
GIT_ARCHIVE_VERSION = "$Format:%H %D$"
HOMEPAGE = 'https://github.com/vagrant-libvirt/vagrant-libvirt'
def self.get_version
if File.... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/errors.rb | lib/vagrant-libvirt/errors.rb | # frozen_string_literal: true
require 'vagrant'
module VagrantPlugins
module ProviderLibvirt
module Errors
class VagrantLibvirtError < Vagrant::Errors::VagrantError
error_namespace('vagrant_libvirt.errors')
end
class CallChainError < VagrantLibvirtError
error_key(:call_chain_e... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/driver.rb | lib/vagrant-libvirt/driver.rb | # frozen_string_literal: true
require 'fog/libvirt'
require 'libvirt'
require 'log4r'
require 'json'
module VagrantPlugins
module ProviderLibvirt
class Driver
# store the connection at the instance level as this will be per
# thread and allows for individual machines to use different
# connect... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/plugin.rb | lib/vagrant-libvirt/plugin.rb | # frozen_string_literal: true
begin
require 'vagrant'
rescue LoadError
raise 'The Vagrant Libvirt plugin must be run within Vagrant.'
end
require 'vagrant-libvirt/util/compat'
module VagrantPlugins
module ProviderLibvirt
class Plugin < Vagrant.plugin('2')
name 'libvirt'
description <<-DESC
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/config.rb | lib/vagrant-libvirt/config.rb | # frozen_string_literal: true
require 'cgi'
require 'vagrant'
require 'vagrant/action/builtin/mixin_synced_folders'
require 'vagrant-libvirt/errors'
require 'vagrant-libvirt/util/resolvers'
require 'vagrant-libvirt/util/network_util'
module VagrantPlugins
module ProviderLibvirt
class Config < Vagrant.plugin('... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | true |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/util.rb | lib/vagrant-libvirt/util.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Util
autoload :ErbTemplate, 'vagrant-libvirt/util/erb_template'
autoload :Collection, 'vagrant-libvirt/util/collection'
autoload :Timer, 'vagrant-libvirt/util/timer'
autoload :NetworkUtil, 'vagrant-libvirt/... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action.rb | lib/vagrant-libvirt/action.rb | # frozen_string_literal: true
require 'vagrant/action/builder'
require 'log4r'
module VagrantPlugins
module ProviderLibvirt
module Action
action_root = Pathname.new(File.expand_path('../action', __FILE__))
autoload :CleanupOnFailure, action_root.join('cleanup_on_failure')
autoload :ClearForwar... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/util/collection.rb | lib/vagrant-libvirt/util/collection.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Util
module Collection
# This method finds a matching _thing_ in a collection of
# _things_. This works matching if the ID or NAME equals to
# `name`. Or, if `name` is a regexp, a partial match is chos... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/util/ui.rb | lib/vagrant-libvirt/util/ui.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Util
module Ui
# Since v2.2.8 Vagrant support --no-tty option, which silences
# progress bars and other interactive elements for cleaner logs
# in scripts, but requires a slight change in UI object han... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/util/nfs.rb | lib/vagrant-libvirt/util/nfs.rb | # frozen_string_literal: true
require 'vagrant/action/builtin/mixin_synced_folders'
module VagrantPlugins
module ProviderLibvirt
module Util
module Nfs
include Vagrant::Action::Builtin::MixinSyncedFolders
# We're using NFS if we have any synced folder with NFS configured. If
# we ... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/util/storage_util.rb | lib/vagrant-libvirt/util/storage_util.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Util
module StorageUtil
def storage_uid(env)
env[:machine].provider_config.qemu_use_session ? Process.uid : 0
end
def storage_gid(env)
env[:machine].provider_config.qemu_use_sessio... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/util/domain_flags.rb | lib/vagrant-libvirt/util/domain_flags.rb | # Ripped from https://libvirt.org/html/libvirt-libvirt-domain.html#types
module VagrantPlugins
module ProviderLibvirt
module Util
module DomainFlags
# virDomainUndefineFlagsValues
VIR_DOMAIN_UNDEFINE_MANAGED_SAVE = 1 # Also remove any managed save
VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METAD... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/util/xml.rb | lib/vagrant-libvirt/util/xml.rb | # frozen_string_literal: true
require 'xmlsimple'
module VagrantPlugins
module ProviderLibvirt
module Util
class Xml
attr_reader :xml
def initialize(xmlstr)
@xml = compact_content(XmlSimple.xml_in(xmlstr, {'NormaliseSpace' => 2}))
end
def to_str
XmlSim... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/util/compat.rb | lib/vagrant-libvirt/util/compat.rb | # frozen_string_literal: true
require 'vagrant'
# compatibility fix to define constant not available Vagrant <1.6
::Vagrant::MachineState::NOT_CREATED_ID ||= :not_created
module VagrantPlugins
module ProviderLibvirt
module Util
module Compat
def self.action_hook_args(name, action)
# han... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/util/resolvers.rb | lib/vagrant-libvirt/util/resolvers.rb | # frozen_string_literal: true
require 'log4r'
require 'vagrant-libvirt/errors'
module VagrantPlugins
module ProviderLibvirt
module Util
class DiskDeviceResolver
attr_reader :existing
def initialize(prefix='vd')
@default_prefix = prefix
@device_indicies = Hash.new
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/util/byte_number.rb | lib/vagrant-libvirt/util/byte_number.rb | class ByteNumber < Numeric
def initialize(int)
@int = int
end
def to_s
@int.to_s
end
def to_i
@int
end
def to_f
@int.to_f
end
def to_B
to_i
end
def to_KB
_compute_unit_to_n_kilo(1)
end
def to_MB
_compute_un... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/util/network_util.rb | lib/vagrant-libvirt/util/network_util.rb | # frozen_string_literal: true
require 'ipaddr'
require 'nokogiri'
require 'vagrant/util/network_ip'
require 'vagrant/util/scoped_hash_override'
class IPAddr
def get_mask
if @addr
_to_string(@mask_addr)
end
end
end
module VagrantPlugins
module ProviderLibvirt
module Util
module NetworkUt... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/util/erb_template.rb | lib/vagrant-libvirt/util/erb_template.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Util
module ErbTemplate
# TODO: remove and use nokogiri builder
def to_xml(template_name = nil, data = binding)
erb = template_name || self.class.to_s.split('::').last.downcase
path = File.... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/util/unindent.rb | lib/vagrant-libvirt/util/unindent.rb | # frozen_string_literal: true
class String
def unindent
gsub(/^#{scan(/^\s*/).min_by{|l|l.length}}/, "")
end
end
| ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/util/error_codes.rb | lib/vagrant-libvirt/util/error_codes.rb | # frozen_string_literal: true
# Ripped from http://libvirt.org/html/libvirt-virterror.html#virErrorNumber.
module VagrantPlugins
module ProviderLibvirt
module Util
module ErrorCodes
VIR_ERR_OK = 0
VIR_ERR_INTERNAL_ERROR = 1 # internal error
VIR_ERR_NO_MEMORY = 2 # memory allocation ... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/util/timer.rb | lib/vagrant-libvirt/util/timer.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Util
class Timer
# A basic utility method that times the execution of the given
# block and returns it.
def self.time
start_time = Time.now.to_f
yield
end_time = Time.now.... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/cap/snapshots.rb | lib/vagrant-libvirt/cap/snapshots.rb | module VagrantPlugins
module ProviderLibvirt
module Cap
class Snapshots
def self.snapshot_list(machine)
return if machine.state.id == :not_created
machine.provider.driver.list_snapshots
end
end
end
end
end
| ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/cap/nic_mac_addresses.rb | lib/vagrant-libvirt/cap/nic_mac_addresses.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Cap
class NicMacAddresses
def self.nic_mac_addresses(machine)
# Vagrant expects a Hash with an index starting at 1 as key
# and the mac as uppercase string without colons as value
nic_mac... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/cap/public_address.rb | lib/vagrant-libvirt/cap/public_address.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Cap
class PublicAddress
def self.public_address(machine)
# This does not need to be a globally routable address, it
# only needs to be accessible from the machine running
# Vagrant.
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/cap/mount_9p.rb | lib/vagrant-libvirt/cap/mount_9p.rb | # frozen_string_literal: true
require 'digest/md5'
require 'vagrant/util/retryable'
module VagrantPlugins
module ProviderLibvirt
module Cap
class Mount9P
extend Vagrant::Util::Retryable
def self.mount_9p_shared_folder(machine, folders)
folders.each do |_name, opts|
#... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/cap/synced_folder_9p.rb | lib/vagrant-libvirt/cap/synced_folder_9p.rb | # frozen_string_literal: true
require 'log4r'
require 'ostruct'
require 'nokogiri'
require 'digest/md5'
require 'vagrant/util/subprocess'
require 'vagrant/errors'
require 'vagrant-libvirt/errors'
require 'vagrant-libvirt/util/erb_template'
module VagrantPlugins
module SyncedFolder9P
class SyncedFolder < Vagra... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/cap/synced_folder_virtiofs.rb | lib/vagrant-libvirt/cap/synced_folder_virtiofs.rb | # frozen_string_literal: true
require 'log4r'
require 'ostruct'
require 'nokogiri'
require 'digest/md5'
require 'vagrant/errors'
require 'vagrant/util/subprocess'
require 'vagrant-libvirt/errors'
require 'vagrant-libvirt/util/erb_template'
module VagrantPlugins
module SyncedFolderVirtioFS
class SyncedFolder <... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/cap/mount_virtiofs.rb | lib/vagrant-libvirt/cap/mount_virtiofs.rb | # frozen_string_literal: true
require 'digest/md5'
require 'vagrant/util/retryable'
module VagrantPlugins
module ProviderLibvirt
module Cap
class MountVirtioFS
extend Vagrant::Util::Retryable
def self.mount_virtiofs_shared_folder(machine, folders)
folders.each do |_name, opts|
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/handle_box_image.rb | lib/vagrant-libvirt/action/handle_box_image.rb | # frozen_string_literal: true
require 'log4r'
require 'open3'
require 'json'
require 'vagrant-libvirt/util/byte_number'
require 'vagrant-libvirt/util/storage_util'
require 'vagrant-libvirt/util/ui'
module VagrantPlugins
module ProviderLibvirt
module Action
class HandleBoxImage
include VagrantPlug... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/package_domain.rb | lib/vagrant-libvirt/action/package_domain.rb | # frozen_string_literal: true
require 'fileutils'
require 'log4r'
require 'vagrant-libvirt/util/ui'
require 'vagrant-libvirt/util/unindent'
module VagrantPlugins
module ProviderLibvirt
module Action
# Action for create new box for Libvirt provider
class PackageDomain
include VagrantPlugins:... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/destroy_networks.rb | lib/vagrant-libvirt/action/destroy_networks.rb | # frozen_string_literal: true
require 'log4r'
require 'nokogiri'
module VagrantPlugins
module ProviderLibvirt
module Action
# Destroy all networks created for this specific domain. Skip
# removing if network has still active connections.
class DestroyNetworks
def initialize(app, _env)
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/message_will_not_destroy.rb | lib/vagrant-libvirt/action/message_will_not_destroy.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Action
class MessageWillNotDestroy
def initialize(app, env)
@app = app
end
def call(env)
env[:ui].info I18n.t("vagrant.commands.destroy.will_not_destroy",
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/is_created.rb | lib/vagrant-libvirt/action/is_created.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Action
# This can be used with "Call" built-in to check if the machine
# is created and branch in the middleware.
class IsCreated
def initialize(app, _env)
@app = app
end
def cal... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/snapshot_delete.rb | lib/vagrant-libvirt/action/snapshot_delete.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Action
class SnapshotDelete
def initialize(app, env)
@app = app
end
def call(env)
env[:ui].info(I18n.t(
"vagrant.actions.vm.snapshot.deleting",
name: env[:s... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/create_domain.rb | lib/vagrant-libvirt/action/create_domain.rb | # frozen_string_literal: true
require 'log4r'
require 'vagrant-libvirt/util/erb_template'
require 'vagrant-libvirt/util/resolvers'
require 'vagrant-libvirt/util/storage_util'
module VagrantPlugins
module ProviderLibvirt
module Action
class CreateDomain
include VagrantPlugins::ProviderLibvirt::Uti... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/snapshot_restore.rb | lib/vagrant-libvirt/action/snapshot_restore.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Action
class SnapshotRestore
def initialize(app, env)
@app = app
end
def call(env)
env[:ui].info(I18n.t(
"vagrant.actions.vm.snapshot.restoring",
name: env[... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/message_not_created.rb | lib/vagrant-libvirt/action/message_not_created.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Action
class MessageNotCreated
def initialize(app, _env)
@app = app
end
def call(env)
env[:ui].info(I18n.t('vagrant_libvirt.not_created'))
@app.call(env)
end
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/resolve_disk_settings.rb | lib/vagrant-libvirt/action/resolve_disk_settings.rb | # frozen_string_literal: true
require 'log4r'
require 'rexml/document'
require 'rexml/xpath'
require 'vagrant-libvirt/util/resolvers'
module VagrantPlugins
module ProviderLibvirt
module Action
class ResolveDiskSettings
def initialize(app, _env)
@logger = Log4r::Logger.new('vagrant_libv... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/prepare_nfs_valid_ids.rb | lib/vagrant-libvirt/action/prepare_nfs_valid_ids.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Action
class PrepareNFSValidIds
def initialize(app, _env)
@app = app
@logger = Log4r::Logger.new('vagrant::action::vm::nfs')
end
def call(env)
env[:nfs_valid_ids] = env[:... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/is_suspended.rb | lib/vagrant-libvirt/action/is_suspended.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Action
# This can be used with "Call" built-in to check if the machine
# is suspended and branch in the middleware.
class IsSuspended
def initialize(app, _env)
@app = app
end
def... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/create_domain_volume.rb | lib/vagrant-libvirt/action/create_domain_volume.rb | # frozen_string_literal: true
require 'log4r'
require 'vagrant-libvirt/util/erb_template'
require 'vagrant-libvirt/util/storage_util'
module VagrantPlugins
module ProviderLibvirt
module Action
# Create a snapshot of base box image. This new snapshot is just new
# cow image with backing storage poin... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/wait_till_up.rb | lib/vagrant-libvirt/action/wait_till_up.rb | # frozen_string_literal: true
require 'log4r'
require 'vagrant-libvirt/errors'
require 'vagrant-libvirt/util/timer'
require 'vagrant/util/retryable'
module VagrantPlugins
module ProviderLibvirt
module Action
# Wait till domain is started, till it obtains an IP address and is
# accessible via ssh.
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/set_boot_order.rb | lib/vagrant-libvirt/action/set_boot_order.rb | # frozen_string_literal: true
require 'log4r'
require 'nokogiri'
module VagrantPlugins
module ProviderLibvirt
module Action
# boot order useful for pxe in discovery workflow
class SetBootOrder
def initialize(app, env)
@app = app
@logger = Log4r::Logger.new('vagrant_lib... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/handle_storage_pool.rb | lib/vagrant-libvirt/action/handle_storage_pool.rb | # frozen_string_literal: true
require 'log4r'
require 'vagrant-libvirt/util/erb_template'
require 'vagrant-libvirt/util/storage_util'
module VagrantPlugins
module ProviderLibvirt
module Action
class HandleStoragePool
include VagrantPlugins::ProviderLibvirt::Util::ErbTemplate
include Vagra... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/suspend_domain.rb | lib/vagrant-libvirt/action/suspend_domain.rb | # frozen_string_literal: true
require 'log4r'
module VagrantPlugins
module ProviderLibvirt
module Action
# Suspend domain.
class SuspendDomain
def initialize(app, _env)
@logger = Log4r::Logger.new('vagrant_libvirt::action::suspend_domain')
@app = app
end
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/share_folders.rb | lib/vagrant-libvirt/action/share_folders.rb | # frozen_string_literal: true
require 'pathname'
require 'log4r'
module VagrantPlugins
module ProviderLibvirt
module Action
class ShareFolders
def initialize(app, _env)
@logger = Log4r::Logger.new('vagrant::action::vm::share_folders')
@app = app
end
def cal... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/create_networks.rb | lib/vagrant-libvirt/action/create_networks.rb | # frozen_string_literal: true
require 'log4r'
require 'vagrant/util/network_ip'
require 'vagrant/util/scoped_hash_override'
require 'ipaddr'
require 'thread'
module VagrantPlugins
module ProviderLibvirt
module Action
# Prepare all networks needed for domain connections.
class CreateNetworks
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/prepare_nfs_settings.rb | lib/vagrant-libvirt/action/prepare_nfs_settings.rb | # frozen_string_literal: true
require 'nokogiri'
require 'socket'
require 'timeout'
require 'vagrant-libvirt/util/nfs'
module VagrantPlugins
module ProviderLibvirt
module Action
class PrepareNFSSettings
include VagrantPlugins::ProviderLibvirt::Util::Nfs
def initialize(app, _env)
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/read_mac_addresses.rb | lib/vagrant-libvirt/action/read_mac_addresses.rb | # frozen_string_literal: true
require 'log4r'
module VagrantPlugins
module ProviderLibvirt
module Action
class ReadMacAddresses
def initialize(app, _env)
@app = app
@logger = Log4r::Logger.new('vagrant_libvirt::action::read_mac_addresses')
end
def call(env)
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/clean_machine_folder.rb | lib/vagrant-libvirt/action/clean_machine_folder.rb | # frozen_string_literal: true
require 'log4r'
module VagrantPlugins
module ProviderLibvirt
module Action
class CleanMachineFolder
def initialize(app, env, options=nil)
@logger = Log4r::Logger.new('vagrant_libvirt::action::create_domain')
@app = app
@ui = env[:ui]
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/is_running.rb | lib/vagrant-libvirt/action/is_running.rb | # frozen_string_literal: true
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 cal... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/snapshot_save.rb | lib/vagrant-libvirt/action/snapshot_save.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Action
class SnapshotSave
def initialize(app, env)
@app = app
end
def call(env)
env[:ui].info(I18n.t(
"vagrant.actions.vm.snapshot.saving",
name: env[:snaps... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/set_name_of_domain.rb | lib/vagrant-libvirt/action/set_name_of_domain.rb | # frozen_string_literal: true
require 'securerandom'
module VagrantPlugins
module ProviderLibvirt
module Action
# Setup name for domain and domain volumes.
class SetNameOfDomain
def initialize(app, _env)
@logger = Log4r::Logger.new('vagrant_libvirt::action::set_name_of_domain')
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/remove_stale_volume.rb | lib/vagrant-libvirt/action/remove_stale_volume.rb | # frozen_string_literal: true
require 'log4r'
# require 'log4r/yamlconfigurator'
module VagrantPlugins
module ProviderLibvirt
module Action
class RemoveStaleVolume
def initialize(app, _env)
# log4r_config= YAML.load_file(File.join(File.dirname(__FILE__),"log4r.yaml"))
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/start_domain.rb | lib/vagrant-libvirt/action/start_domain.rb | # frozen_string_literal: true
require 'log4r'
require 'rexml/document'
require 'rexml/formatters/pretty'
require 'rexml/xpath'
require 'vagrant-libvirt/util/network_util'
require 'vagrant-libvirt/util/xml'
module VagrantPlugins
module ProviderLibvirt
module Action
# Just start the domain.
class St... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/halt_domain.rb | lib/vagrant-libvirt/action/halt_domain.rb | # 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 c... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/message_already_created.rb | lib/vagrant-libvirt/action/message_already_created.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Action
class MessageAlreadyCreated
def initialize(app, _env)
@app = app
end
def call(env)
env[:ui].info(I18n.t('vagrant_libvirt.already_created'))
@app.call(env)
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/create_network_interfaces.rb | lib/vagrant-libvirt/action/create_network_interfaces.rb | # frozen_string_literal: true
require 'log4r'
require 'vagrant-libvirt/util/erb_template'
require 'vagrant-libvirt/util/network_util'
module VagrantPlugins
module ProviderLibvirt
module Action
# Create network interfaces for domain, before domain is running.
# Networks for connecting those interfac... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/destroy_domain.rb | lib/vagrant-libvirt/action/destroy_domain.rb | # frozen_string_literal: true
require 'log4r'
require 'rexml/document'
require 'rexml/xpath'
require 'vagrant-libvirt/util/domain_flags'
module VagrantPlugins
module ProviderLibvirt
module Action
class DestroyDomain
def initialize(app, _env)
@logger = Log4r::Logger.new('vagrant_libvirt... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/forward_ports.rb | lib/vagrant-libvirt/action/forward_ports.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Action
# Adds support for vagrant's `forward_ports` configuration directive.
class ForwardPorts
@@lock = Mutex.new
def initialize(app, env)
@app = app
@logger = Log4r::Logger.new(... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/prune_nfs_exports.rb | lib/vagrant-libvirt/action/prune_nfs_exports.rb | # frozen_string_literal: true
require 'vagrant-libvirt/util/nfs'
require 'yaml'
module VagrantPlugins
module ProviderLibvirt
module Action
class PruneNFSExports
include VagrantPlugins::ProviderLibvirt::Util::Nfs
def initialize(app, _env)
@logger = Log4r::Logger.new('vagrant_libv... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/shutdown_domain.rb | lib/vagrant-libvirt/action/shutdown_domain.rb | require 'log4r'
module VagrantPlugins
module ProviderLibvirt
module Action
# To wrap GracefulShutdown need to track the time taken
class StartShutdownTimer
def initialize(app, _env)
@app = app
end
def call(env)
env[:shutdown_start_time] = Time.now
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/message_not_suspended.rb | lib/vagrant-libvirt/action/message_not_suspended.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Action
class MessageNotSuspended
def initialize(app, _env)
@app = app
end
def call(env)
env[:ui].info(I18n.t('vagrant_libvirt.not_suspended'))
@app.call(env)
end
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/resume_domain.rb | lib/vagrant-libvirt/action/resume_domain.rb | # frozen_string_literal: true
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
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/message_not_running.rb | lib/vagrant-libvirt/action/message_not_running.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Action
class MessageNotRunning
def initialize(app, _env)
@app = app
end
def call(env)
env[:ui].info(I18n.t('vagrant_libvirt.not_running'))
@app.call(env)
end
... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/remove_libvirt_image.rb | lib/vagrant-libvirt/action/remove_libvirt_image.rb | # frozen_string_literal: true
require 'log4r'
module VagrantPlugins
module ProviderLibvirt
module Action
class RemoveLibvirtImage
def initialize(app, _env)
@logger = Log4r::Logger.new('vagrant_libvirt::action::remove_libvirt_image')
@app = app
end
def call(env)... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
vagrant-libvirt/vagrant-libvirt | https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a94ce0d7b6c90129a38435698ca97b364130313d/lib/vagrant-libvirt/action/cleanup_on_failure.rb | lib/vagrant-libvirt/action/cleanup_on_failure.rb | # frozen_string_literal: true
module VagrantPlugins
module ProviderLibvirt
module Action
class CleanupOnFailure
def initialize(app, _env)
@logger = Log4r::Logger.new('vagrant_libvirt::action::cleanup_on_failure')
@app = app
@cleanup = true
end
def cal... | ruby | MIT | a94ce0d7b6c90129a38435698ca97b364130313d | 2026-01-04T15:56:05.820716Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/support/runfile/example.rb | support/runfile/example.rb | require 'yaml'
# A helper class used in Runfile to generate example README files
class Example
class << self
def examples
filter_dirs('examples').map { |dir| new dir }
end
def fixtures
filter_dirs('spec/fixtures/workspaces')
.select { |dir| File.exist? "#{dir}/src/bashly.yml" }
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/spec_mixin.rb | spec/spec_mixin.rb | module SpecMixin
def reset_tmp_dir(create_src: false, init: false, example: nil)
system 'rm -rf spec/tmp/*'
system 'mkdir -p spec/tmp'
system 'mkdir -p spec/tmp/src' if create_src || init
cp "examples/#{example}/*" if example
cp 'lib/bashly/templates/bashly.yml', 'spec/tmp/src' if init
end
de... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/spec_helper.rb | spec/spec_helper.rb | require 'simplecov'
unless ENV['NOCOV']
SimpleCov.start do
enable_coverage :branch if ENV['BRANCH_COV']
coverage_dir 'spec/coverage'
end
end
require 'rubygems'
require 'bundler'
Bundler.require :default, :development
require 'bashly'
include Bashly
require_relative 'spec_mixin'
include SpecMixin
# Set ... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/render_source_spec.rb | spec/bashly/render_source_spec.rb | describe RenderSource do
subject { described_class.new selector }
let(:selector) { :markdown }
let(:path_to_source) { 'lib/bashly/libraries/render/markdown' }
describe '::internal' do
it 'returns a hash of all internal RenderSource objects' do
expect(described_class.internal).to be_a Hash
expe... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/library_source_spec.rb | spec/bashly/library_source_spec.rb | describe LibrarySource do
subject { described_class.new uri }
let(:uri) { nil }
after(:all) { described_class.new.cleanup }
describe '#uri' do
context 'when it starts with github:' do
let(:uri) { 'github:user/repo//the-path@the-ref' }
it 'is transformed to git over https' do
expect(s... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/library_spec.rb | spec/bashly/library_spec.rb | describe Library do
subject { LibrarySource.new.libraries[name] }
let(:name) { :colors }
let(:lib_dir) { 'lib/bashly/libraries/colors' }
describe '#files' do
it 'returns an array of hashes' do
expect(subject.files).to be_an Array
expect(subject.files.first).to be_a Hash
end
it 'return... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/config_validator_spec.rb | spec/bashly/config_validator_spec.rb | describe ConfigValidator do
fixtures = load_fixture 'script/validations'
describe '#validate' do
fixtures.each do |fixture, options|
validator = described_class.new options
context "with :#{fixture}" do
it 'raises an error' do
expect { validator.validate }.to raise_approval("vali... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/settings_spec.rb | spec/bashly/settings_spec.rb | describe Settings do
subject { BaselineSettings.clone }
describe 'standard value' do
it 'returns a predefined default value' do
expect(subject.tab_indent).to be false
end
context 'when settings.yml exists' do
before do
reset_tmp_dir
File.write 'spec/tmp/settings.yml', 'sour... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/library_source_config_spec.rb | spec/bashly/library_source_config_spec.rb | describe LibrarySourceConfig do
fixtures = Dir['spec/fixtures/libraries_validation/*.yml']
subject { described_class.new path }
let(:path) { 'spec/fixtures/libraries/libraries.yml' }
describe '#validated_data' do
it 'returns the data after validating it' do
expect(subject).to receive(:validate)
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/bin_spec.rb | spec/bashly/bin_spec.rb | describe 'bin/bashly', :slow do
subject { CLI.runner }
it 'shows list of commands' do
expect { subject.run }.to output_approval('cli/commands')
end
context 'when an error occurs' do
it 'displays it nicely' do
expect(`bin/bashly generate 2>&1`).to match_approval('cli/error')
end
end
end
| ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/config_spec.rb | spec/bashly/config_spec.rb | describe Config do
subject { described_class.new config }
let(:config) { { 'hello' => 'world' } }
describe '::new' do
it 'returns a hash (and not a Config object)' do
expect(subject).to be_a Hash
end
end
context 'with a hash argument' do
it 'returns the hash' do
expect(subject['hell... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/message_strings_spec.rb | spec/bashly/message_strings_spec.rb | describe MessageStrings do
describe '[]' do
it 'returns a default string for use in the generated bash' do
expect(subject[:usage]).to eq 'Usage:'
end
end
context 'when there is an override user configuration file' do
let(:config_template) { 'examples/custom-strings/src/bashly-strings.yml' }
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/concerns/indentation_helper_spec.rb | spec/bashly/concerns/indentation_helper_spec.rb | describe IndentationHelper do
# Since `IndentationHelper` is a stateful class that operates on a
# line-by-line basis, the `IndentationHelper#indent` method is tested via
# the `Array#indent` extension for convenience and clarity.
describe '#indent' do
subject { ['root:', ' indented:'] }
it 'prepends ... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/concerns/completions_command_spec.rb | spec/bashly/concerns/completions_command_spec.rb | describe Script::Command do
fixtures = load_fixture 'script/commands'
subject { described_class.new fixtures[fixture] }
let(:fixture) { :completions_simple }
describe '#completion_data' do
it 'returns a data structure for completely' do
expect(subject.completion_data.to_yaml).to match_approval('com... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/concerns/asset_helper_spec.rb | spec/bashly/concerns/asset_helper_spec.rb | describe AssetHelper do
subject { Class.new { include AssetHelper }.new }
let(:path) { 'version.rb' }
describe '#asset' do
it 'returns a path to any file in the source tree' do
expect(subject.asset(path)).to end_with "lib/bashly/#{path}"
end
end
describe '#asset_content' do
it 'returns th... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/concerns/completions_flag_spec.rb | spec/bashly/concerns/completions_flag_spec.rb | describe Script::Flag do
fixtures = load_fixture 'script/flags'
subject { described_class.new fixtures[fixture] }
let(:fixture) { :basic_flag }
let(:command) { 'some command' }
describe '#completion_data' do
context 'when the flag has allowed defined' do
let(:fixture) { :completions_allowed }
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/integration/rendering_markdown_spec.rb | spec/bashly/integration/rendering_markdown_spec.rb | # This spec tests that the rendering using the libraries/render templates
# is generating the expected output.
describe 'rendering markdown', :stable do
subject { Commands::Render.new }
let(:source_dir) { Settings.source_dir }
target = 'spec/tmp'
examples = %w[
catch-all-advanced
dependencies-alt
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.