Class: VCenterConf

Inherits:
Hash
  • Object
show all
Defined in:
lib/vcenter_driver.rb

Overview

Holds vCenter configuration parameters

Constant Summary collapse

DEFAULT_CONFIGURATION =
{
    :delete_images => false,
    :vm_poweron_wait_default => 300,
    :debug_information => false,
    :retries => 3,
    :retry_interval => 1
}

Instance Method Summary collapse

Methods inherited from Hash

#deep_merge

Constructor Details

#initializeVCenterConf

Returns a new instance of VCenterConf.



74
75
76
77
78
79
80
81
82
83
84
# File 'lib/vcenter_driver.rb', line 74

def initialize
    replace(DEFAULT_CONFIGURATION)
    begin
        vcenterrc_path = "#{VAR_LOCATION}/remotes/etc/vmm/vcenter/vcenterrc"
        merge!(YAML.load_file(vcenterrc_path))
    rescue StandardError => e
        STDERR.puts "Couldn't load vcenterrc. Reason #{e.message}."
    end

    super
end