Sha256: a2d2f924ea0366355a2f5007d344fb881aa89723efef329c50966da64359613d

Contents?: true

Size: 802 Bytes

Versions: 4

Compression:

Stored size: 802 Bytes

Contents

require 'beaker/hypervisor/vagrant'

class Beaker::VagrantLibvirt < Beaker::Vagrant
  @memory = nil
  @cpu    = nil

  class << self
    attr_reader :memory
  end

  def provision(provider = 'libvirt')
    super
  end

  def self.provider_vfile_section(host, options)
    "    v.vm.provider :libvirt do |node|\n" +
      "      node.cpus = #{cpus(host, options)}\n" +
      "      node.memory = #{memsize(host, options)}\n" +
      build_options_str(options) +
      "    end\n"
  end

  def self.build_options_str(options)
    other_options_str = ''
    if options['libvirt']
      other_options = []
      options['libvirt'].each do |k, v|
        other_options << "      node.#{k} = '#{v}'"
      end
      other_options_str = other_options.join("\n")
    end
    "#{other_options_str}\n"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
beaker-3.10.0 lib/beaker/hypervisor/vagrant_libvirt.rb
beaker-3.9.0 lib/beaker/hypervisor/vagrant_libvirt.rb
beaker-3.8.0 lib/beaker/hypervisor/vagrant_libvirt.rb
beaker-3.7.0 lib/beaker/hypervisor/vagrant_libvirt.rb