mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Enable frozen string across project (#1319)
Turn on frozen string support in all files by using a comment to avoid enabling across dependencies where it may not work. Fixes: #1177
This commit is contained in:
parent
6dac9c9054
commit
18ebb9d9ed
2
Gemfile
2
Gemfile
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
source 'https://rubygems.org'
|
||||
|
||||
# Specify your gem's dependencies in vagrant-libvirt.gemspec
|
||||
|
1
Rakefile
1
Rakefile
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
#require 'rubygems'
|
||||
#require 'bundler/setup'
|
||||
require 'bundler/gem_tasks'
|
||||
|
2
example_box/Vagrantfile
vendored
2
example_box/Vagrantfile
vendored
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'pathname'
|
||||
|
||||
module VagrantPlugins
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'vagrant/action/builder'
|
||||
require 'log4r'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
|
||||
module VagrantPlugins
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
|
||||
module VagrantPlugins
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
|
||||
module VagrantPlugins
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
require 'vagrant/util/network_ip'
|
||||
require 'vagrant/util/scoped_hash_override'
|
||||
@ -128,10 +130,10 @@ module VagrantPlugins
|
||||
end
|
||||
|
||||
message = "Creating network interface eth#{@iface_number}"
|
||||
message << " connected to network #{@network_name}."
|
||||
message += " connected to network #{@network_name}."
|
||||
if @mac
|
||||
@mac = @mac.scan(/(\h{2})/).join(':')
|
||||
message << " Using MAC address: #{@mac}"
|
||||
message += " Using MAC address: #{@mac}"
|
||||
end
|
||||
@logger.info(message)
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
require 'vagrant/util/network_ip'
|
||||
require 'vagrant/util/scoped_hash_override'
|
||||
@ -312,8 +314,7 @@ module VagrantPlugins
|
||||
|
||||
if @options[:dhcp_enabled]
|
||||
# Find out DHCP addresses pool range.
|
||||
network_address = "#{@interface_network[:network_address]}/"
|
||||
network_address << (@interface_network[:netmask]).to_s
|
||||
network_address = "#{@interface_network[:network_address]}/#{(@interface_network[:netmask]).to_s}"
|
||||
net = @interface_network[:network_address] ? IPAddr.new(network_address) : nil
|
||||
|
||||
# First is address of network, second is gateway (by default).
|
||||
@ -345,10 +346,9 @@ module VagrantPlugins
|
||||
|
||||
created_networks_file = env[:machine].data_dir + 'created_networks'
|
||||
|
||||
message = 'Saving information about created network '
|
||||
message << "#{@interface_network[:name]}, "
|
||||
message << "UUID=#{@interface_network[:libvirt_network].uuid} "
|
||||
message << "to file #{created_networks_file}."
|
||||
message = 'Saving information about created network ' \
|
||||
"#{@interface_network[:name]}, UUID=#{@interface_network[:libvirt_network].uuid} " \
|
||||
"to file #{created_networks_file}."
|
||||
@logger.info(message)
|
||||
|
||||
File.open(created_networks_file, 'a') do |file|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
|
||||
module VagrantPlugins
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
require 'nokogiri'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Action
|
||||
@ -104,7 +106,7 @@ module VagrantPlugins
|
||||
IdentitiesOnly=#{ssh_info[:keys_only] ? 'yes' : 'no'}
|
||||
) + ssh_info[:private_key_path].map do |pk|
|
||||
"IdentityFile='\"#{pk}\"'"
|
||||
end).map { |s| s.prepend('-o ') }.join(' ')
|
||||
end).map { |s| "-o #{s}" }.join(' ')
|
||||
|
||||
options += " -o ProxyCommand=\"#{ssh_info[:proxy_command]}\"" if machine.provider_config.proxy_command
|
||||
|
||||
@ -116,12 +118,12 @@ module VagrantPlugins
|
||||
env[:ui].info 'Requesting sudo for host port(s) <= 1024'
|
||||
r = system('sudo -v')
|
||||
if r
|
||||
ssh_cmd << 'sudo ' # add sudo prefix
|
||||
ssh_cmd += 'sudo ' # add sudo prefix
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ssh_cmd << "ssh -n #{options} #{params}"
|
||||
ssh_cmd += "ssh -n #{options} #{params}"
|
||||
|
||||
@logger.debug "Forwarding port with `#{ssh_cmd}`"
|
||||
log_file = ssh_forward_log_file(
|
||||
@ -180,10 +182,10 @@ module VagrantPlugins
|
||||
kill_cmd = ''
|
||||
|
||||
if tag[:port] <= 1024
|
||||
kill_cmd << 'sudo ' # add sudo prefix
|
||||
kill_cmd += 'sudo ' # add sudo prefix
|
||||
end
|
||||
|
||||
kill_cmd << "kill #{tag[:pid]}"
|
||||
kill_cmd += "kill #{tag[:pid]}"
|
||||
@@lock.synchronize do
|
||||
system(kill_cmd)
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
|
||||
module VagrantPlugins
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
require 'open3'
|
||||
require 'json'
|
||||
@ -179,8 +181,7 @@ module VagrantPlugins
|
||||
raise Vagrant::Errors::BoxNotFound, name: env[:machine].box.name
|
||||
end
|
||||
box_image_size = File.size(box_image_file) # B
|
||||
message = "Creating volume #{box_volume[:name]}"
|
||||
message << " in storage pool #{config.storage_pool_name}."
|
||||
message = "Creating volume #{box_volume[:name]} in storage pool #{config.storage_pool_name}."
|
||||
@logger.info(message)
|
||||
begin
|
||||
fog_volume = env[:machine].provider.driver.connection.volumes.create(
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
|
||||
module VagrantPlugins
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Action
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Action
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Action
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Action
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Action
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Action
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Action
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Action
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'fileutils'
|
||||
require 'log4r'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'nokogiri'
|
||||
require 'socket'
|
||||
require 'timeout'
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Action
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'vagrant-libvirt/util/nfs'
|
||||
require 'yaml'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
|
||||
module VagrantPlugins
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
|
||||
module VagrantPlugins
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
# require 'log4r/yamlconfigurator'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
|
||||
module VagrantPlugins
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
require 'nokogiri'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'securerandom'
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
@ -46,7 +48,7 @@ module VagrantPlugins
|
||||
env[:root_path].basename.to_s.dup.concat('_')
|
||||
elsif config.default_prefix.empty?
|
||||
# don't have any prefix, not even "_"
|
||||
''
|
||||
String.new
|
||||
else
|
||||
config.default_prefix.to_s.dup
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'pathname'
|
||||
|
||||
require 'log4r'
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
require 'rexml/document'
|
||||
|
||||
@ -165,7 +167,7 @@ module VagrantPlugins
|
||||
|
||||
# clock timers - because timers can be added/removed, just rebuild and then compare
|
||||
if !config.clock_timers.empty? || clock.has_elements?
|
||||
oldclock = ''
|
||||
oldclock = String.new
|
||||
formatter.write(REXML::XPath.first(xml_descr, '/domain/clock'), oldclock)
|
||||
clock.delete_element('//timer')
|
||||
config.clock_timers.each do |clock_timer|
|
||||
@ -175,7 +177,7 @@ module VagrantPlugins
|
||||
end
|
||||
end
|
||||
|
||||
newclock = ''
|
||||
newclock = String.new
|
||||
formatter.write(clock, newclock)
|
||||
unless newclock.eql? oldclock
|
||||
@logger.debug "clock timers config changed"
|
||||
@ -337,22 +339,22 @@ module VagrantPlugins
|
||||
if descr_changed
|
||||
begin
|
||||
libvirt_domain.undefine
|
||||
new_descr = ''
|
||||
new_descr = String.new
|
||||
xml_descr.write new_descr
|
||||
server = env[:machine].provider.driver.connection.servers.create(xml: new_descr)
|
||||
env[:machine].provider.driver.connection.servers.create(xml: new_descr)
|
||||
rescue Fog::Errors::Error => e
|
||||
server = env[:machine].provider.driver.connection.servers.create(xml: descr)
|
||||
env[:machine].provider.driver.connection.servers.create(xml: descr)
|
||||
raise Errors::FogCreateServerError, error_message: e.message
|
||||
end
|
||||
end
|
||||
rescue => e
|
||||
rescue Errors::VagrantLibvirtError => e
|
||||
env[:ui].error("Error when updating domain settings: #{e.message}")
|
||||
end
|
||||
# Autostart with host if enabled in Vagrantfile
|
||||
libvirt_domain.autostart = config.autostart
|
||||
# Actually start the domain
|
||||
domain.start
|
||||
rescue => e
|
||||
rescue Fog::Errors::Error, Errors::VagrantLibvirtError => e
|
||||
raise Errors::FogError, message: e.message
|
||||
end
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
|
||||
module VagrantPlugins
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
require 'vagrant-libvirt/errors'
|
||||
require 'vagrant-libvirt/util/timer'
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'digest/md5'
|
||||
require 'vagrant/util/retryable'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'digest/md5'
|
||||
require 'vagrant/util/retryable'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Cap
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Cap
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
require 'ostruct'
|
||||
require 'nokogiri'
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'log4r'
|
||||
require 'ostruct'
|
||||
require 'nokogiri'
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'cgi'
|
||||
|
||||
require 'vagrant'
|
||||
@ -5,10 +7,10 @@ require 'vagrant'
|
||||
class Numeric
|
||||
Alphabet = ('a'..'z').to_a
|
||||
def vdev
|
||||
s = ''
|
||||
s = String.new
|
||||
q = self
|
||||
(q, r = (q - 1).divmod(26)) && s.prepend(Alphabet[r]) until q.zero?
|
||||
'vd' + s
|
||||
"vd#{s}"
|
||||
end
|
||||
end
|
||||
|
||||
@ -352,7 +354,7 @@ module VagrantPlugins
|
||||
# hda - hdc
|
||||
curr = 'a'.ord
|
||||
while curr <= 'd'.ord
|
||||
dev = 'hd' + curr.chr
|
||||
dev = "hd#{curr.chr}"
|
||||
if exist[dev]
|
||||
curr += 1
|
||||
next
|
||||
@ -745,24 +747,24 @@ module VagrantPlugins
|
||||
if @connect_via_ssh == true
|
||||
finalize_id_ssh_key_file
|
||||
|
||||
uri << '+ssh://'
|
||||
uri << @username + '@' if @username && @username != UNSET_VALUE
|
||||
uri += '+ssh://'
|
||||
uri += "#{@username}@" if @username && @username != UNSET_VALUE
|
||||
|
||||
uri << ( @host && @host != UNSET_VALUE ? @host : 'localhost' )
|
||||
uri += (@host && @host != UNSET_VALUE ? @host : 'localhost')
|
||||
|
||||
params['no_verify'] = '1'
|
||||
params['keyfile'] = @id_ssh_key_file if @id_ssh_key_file
|
||||
else
|
||||
uri << '://'
|
||||
uri << @host if @host && @host != UNSET_VALUE
|
||||
uri += '://'
|
||||
uri += @host if @host && @host != UNSET_VALUE
|
||||
end
|
||||
|
||||
uri << virt_path
|
||||
uri += virt_path
|
||||
|
||||
# set path to Libvirt socket
|
||||
params['socket'] = @socket if @socket
|
||||
|
||||
uri << "?" + params.map{|pair| pair.join('=')}.join('&') if !params.empty?
|
||||
uri += '?' + params.map { |pair| pair.join('=') }.join('&') unless params.empty?
|
||||
uri
|
||||
end
|
||||
|
||||
@ -955,11 +957,10 @@ module VagrantPlugins
|
||||
|
||||
machine.config.vm.networks.each do |_type, opts|
|
||||
if opts[:mac]
|
||||
opts[:mac].downcase!
|
||||
if opts[:mac] =~ /\A([0-9a-f]{12})\z/
|
||||
if opts[:mac] =~ /\A([0-9a-fA-F]{12})\z/
|
||||
opts[:mac] = opts[:mac].scan(/../).join(':')
|
||||
end
|
||||
unless opts[:mac] =~ /\A([0-9a-f]{2}:){5}([0-9a-f]{2})\z/
|
||||
unless opts[:mac] =~ /\A([0-9a-fA-F]{2}:){5}([0-9a-fA-F]{2})\z/
|
||||
errors << "Configured NIC MAC '#{opts[:mac]}' is not in 'xx:xx:xx:xx:xx:xx' or 'xxxxxxxxxxxx' format"
|
||||
end
|
||||
end
|
||||
@ -1032,7 +1033,7 @@ module VagrantPlugins
|
||||
def resolve_ssh_key_file(key_file)
|
||||
# set ssh key for access to Libvirt host
|
||||
# if no slash, prepend $HOME/.ssh/
|
||||
key_file.prepend("#{ENV['HOME']}/.ssh/") if key_file && key_file !~ /\A\//
|
||||
key_file = "#{ENV['HOME']}/.ssh/#{key_file}" if key_file && key_file !~ /\A\//
|
||||
|
||||
key_file
|
||||
end
|
||||
@ -1061,17 +1062,17 @@ module VagrantPlugins
|
||||
if @connect_via_ssh
|
||||
if @proxy_command == UNSET_VALUE
|
||||
proxy_command = "ssh '#{@host}' "
|
||||
proxy_command << "-p #{@port} " if @port
|
||||
proxy_command << "-l '#{@username}' " if @username
|
||||
proxy_command << "-i '#{@id_ssh_key_file}' " if @id_ssh_key_file
|
||||
proxy_command << '-W %h:%p'
|
||||
proxy_command += "-p #{@port} " if @port
|
||||
proxy_command += "-l '#{@username}' " if @username
|
||||
proxy_command += "-i '#{@id_ssh_key_file}' " if @id_ssh_key_file
|
||||
proxy_command += '-W %h:%p'
|
||||
else
|
||||
inputs = { host: @host }
|
||||
inputs << { port: @port } if @port
|
||||
inputs[:username] = @username if @username
|
||||
inputs[:id_ssh_key_file] = @id_ssh_key_file if @id_ssh_key_file
|
||||
|
||||
proxy_command = @proxy_command
|
||||
proxy_command = String.new(@proxy_command)
|
||||
# avoid needing to escape '%' symbols
|
||||
inputs.each do |key, value|
|
||||
proxy_command.gsub!("{#{key}}", value)
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'fog/libvirt'
|
||||
require 'libvirt'
|
||||
require 'log4r'
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'vagrant'
|
||||
|
||||
module VagrantPlugins
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
begin
|
||||
require 'vagrant'
|
||||
rescue LoadError
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'vagrant'
|
||||
|
||||
module VagrantPlugins
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Util
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Util
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Util
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Ripped from http://libvirt.org/html/libvirt-virterror.html#virErrorNumber.
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'ipaddr'
|
||||
require 'nokogiri'
|
||||
require 'vagrant/util/network_ip'
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Util
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Util
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'open3'
|
||||
require 'tmpdir'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'simplecov'
|
||||
require 'simplecov-lcov'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
##
|
||||
# A simple extension of the Proc class that supports setting a custom binding
|
||||
# and evaluates everything in the Proc using the new binding.
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'ostruct'
|
||||
require 'pathname'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'fog/libvirt'
|
||||
|
||||
shared_context 'libvirt' do
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rspec/expectations/version"
|
||||
#
|
||||
# Taken from https://github.com/cucumber/aruba/blob/main/lib/aruba/matchers/file/have_file_content.rb
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
shared_context 'unit' do
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
shared_context 'temporary_dir' do
|
||||
around do |example|
|
||||
Dir.mktmpdir("rspec-") do |dir|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
require 'support/sharedcontext'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
require 'support/sharedcontext'
|
||||
require 'support/libvirt_context'
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
require 'support/sharedcontext'
|
||||
require 'support/libvirt_context'
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
require 'support/sharedcontext'
|
||||
require 'support/libvirt_context'
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
require 'support/sharedcontext'
|
||||
require 'support/libvirt_context'
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
require 'support/sharedcontext'
|
||||
require 'support/libvirt_context'
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
require 'support/sharedcontext'
|
||||
@ -77,7 +79,7 @@ describe VagrantPlugins::ProviderLibvirt::Action::HandleBoxImage do
|
||||
]
|
||||
}
|
||||
allow(env[:machine]).to receive_message_chain("box.directory.join") do |arg|
|
||||
'/test/'.concat(arg.to_s)
|
||||
'/test/' + arg.to_s
|
||||
end
|
||||
end
|
||||
|
||||
@ -197,7 +199,7 @@ describe VagrantPlugins::ProviderLibvirt::Action::HandleBoxImage do
|
||||
],
|
||||
]}
|
||||
allow(env[:machine]).to receive_message_chain("box.directory.join") do |arg|
|
||||
'/test/'.concat(arg.to_s)
|
||||
'/test/' + arg.to_s
|
||||
end
|
||||
allow(status).to receive(:success?).and_return(true)
|
||||
allow(Open3).to receive(:capture3).with('qemu-img', 'info', '--output=json', '/test/box.img').and_return([
|
||||
@ -334,7 +336,7 @@ describe VagrantPlugins::ProviderLibvirt::Action::HandleBoxImage do
|
||||
]
|
||||
}
|
||||
allow(env[:machine]).to receive_message_chain("box.directory.join") do |arg|
|
||||
'/test/'.concat(arg.to_s)
|
||||
'/test/' + arg.to_s
|
||||
end
|
||||
end
|
||||
|
||||
@ -354,7 +356,7 @@ describe VagrantPlugins::ProviderLibvirt::Action::HandleBoxImage do
|
||||
allow(env[:machine]).to receive_message_chain("box.version") { '1.1.1' }
|
||||
allow(env[:machine]).to receive_message_chain("box.metadata") { box_metadata }
|
||||
allow(env[:machine]).to receive_message_chain("box.directory.join") do |arg|
|
||||
'/test/'.concat(arg.to_s)
|
||||
'/test/' + arg.to_s
|
||||
end
|
||||
allow(status).to receive(:success?).and_return(true)
|
||||
allow(Open3).to receive(:capture3).with('qemu-img', 'info', "--output=json", '/test/box.img').and_return([
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
require 'support/sharedcontext'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe VagrantPlugins::ProviderLibvirt::Action::SetNameOfDomain do
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
require 'support/sharedcontext'
|
||||
require 'support/libvirt_context'
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'vagrant-libvirt/action/wait_till_up'
|
||||
require 'vagrant-libvirt/errors'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'support/binding_proc'
|
||||
|
||||
require 'spec_helper'
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'support/sharedcontext'
|
||||
|
||||
require 'vagrant-libvirt/config'
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
require 'vagrant-libvirt/util/byte_number'
|
||||
|
2
tests/cpus/Vagrantfile
vendored
2
tests/cpus/Vagrantfile
vendored
@ -1,5 +1,7 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
#
|
||||
# frozen_string_literal: true
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "infernix/tinycore"
|
||||
|
2
tests/default_prefix/Vagrantfile
vendored
2
tests/default_prefix/Vagrantfile
vendored
@ -1,5 +1,7 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
#
|
||||
# frozen_string_literal: true
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "infernix/tinycore"
|
||||
|
2
tests/memory/Vagrantfile
vendored
2
tests/memory/Vagrantfile
vendored
@ -1,5 +1,7 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
#
|
||||
# frozen_string_literal: true
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "infernix/tinycore"
|
||||
|
2
tests/package_complex_example/Vagrantfile
vendored
2
tests/package_complex_example/Vagrantfile
vendored
@ -1,5 +1,7 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
#
|
||||
# frozen_string_literal: true
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "generic/debian10"
|
||||
|
2
tests/package_simple/Vagrantfile
vendored
2
tests/package_simple/Vagrantfile
vendored
@ -1,5 +1,7 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
#
|
||||
# frozen_string_literal: true
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "infernix/tinycore"
|
||||
|
2
tests/private_network/Vagrantfile
vendored
2
tests/private_network/Vagrantfile
vendored
@ -1,5 +1,7 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
#
|
||||
# frozen_string_literal: true
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
# private network doesnt work with tinycore, use
|
||||
|
2
tests/second_disk/Vagrantfile
vendored
2
tests/second_disk/Vagrantfile
vendored
@ -1,5 +1,7 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
#
|
||||
# frozen_string_literal: true
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "infernix/tinycore"
|
||||
|
2
tests/simple/Vagrantfile
vendored
2
tests/simple/Vagrantfile
vendored
@ -1,5 +1,7 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
#
|
||||
# frozen_string_literal: true
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "infernix/tinycore"
|
||||
|
2
tests/simple_provision_shell/Vagrantfile
vendored
2
tests/simple_provision_shell/Vagrantfile
vendored
@ -1,5 +1,7 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
#
|
||||
# frozen_string_literal: true
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "infernix/tinycore"
|
||||
|
2
tests/two_disks/Vagrantfile
vendored
2
tests/two_disks/Vagrantfile
vendored
@ -1,5 +1,7 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
#
|
||||
# frozen_string_literal: true
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "infernix/tinycore-two-disks"
|
||||
|
@ -1,4 +1,5 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
# frozen_string_literal: true
|
||||
require File.expand_path('../lib/vagrant-libvirt/version', __FILE__)
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
|
Loading…
Reference in New Issue
Block a user