class VagrantPlugins::OVirtProvider::Config

Attributes

ca_cert_file[RW]
ca_cert_store[RW]
ca_no_verify[RW]

TODO: change 'ca_cert_store' to 'ca_cert' once rbovirt PR #55 merges.

cluster[RW]
console[RW]
cpus[RW]
datacenter[RW]
disk_size[RW]
filtered_api[RW]
memory[RW]

Domain specific settings used while creating new machine.

password[RW]
template[RW]
url[RW]
username[RW]

Public Class Methods

new() click to toggle source
# File lib/vagrant-ovirt3/config.rb, line 26
def initialize
  @url            = UNSET_VALUE
  @username       = UNSET_VALUE
  @password       = UNSET_VALUE
  @datacenter     = UNSET_VALUE
  @cluster        = UNSET_VALUE
  @filtered_api   = UNSET_VALUE

  # Domain specific settings.
  @memory     = UNSET_VALUE
  @cpus       = UNSET_VALUE
  @template   = UNSET_VALUE
  @console    = UNSET_VALUE
  @disk_size  = UNSET_VALUE

  @ca_no_verify = UNSET_VALUE
  @ca_cert_store = UNSET_VALUE
  @ca_cert_file = UNSET_VALUE
end

Public Instance Methods

finalize!() click to toggle source
# File lib/vagrant-ovirt3/config.rb, line 46
def finalize!
  @url = nil if @url == UNSET_VALUE
  @username = nil if @username == UNSET_VALUE
  @password = nil if @password == UNSET_VALUE
  @datacenter = nil if @datacenter == UNSET_VALUE
  @cluster = nil if @cluster == UNSET_VALUE
  @filtered_api = false if @filtered_api == UNSET_VALUE

  # Domain specific settings.
  @memory = 512 if @memory == UNSET_VALUE
  @cpus = 1 if @cpus == UNSET_VALUE
  @template = 'Blank' if @template == UNSET_VALUE
  @console = 'spice' if @console == UNSET_VALUE
  @disk_size = nil if @disk_size == UNSET_VALUE

  @ca_no_verify = false if @ca_no_verify == UNSET_VALUE
  @ca_cert_store = nil if @ca_cert_store == UNSET_VALUE
  @ca_cert_file = nil if @ca_cert_file == UNSET_VALUE
end
validate(machine) click to toggle source
# File lib/vagrant-ovirt3/config.rb, line 66
def validate(machine)
  valid_console_types = ['vnc', 'spice']
  raise Error::InvalidConsoleType,
    :console => @console unless valid_console_types.include? @console
end