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

Constructor Details

#initializeVCenterConf

Returns a new instance of VCenterConf.



52
53
54
55
56
57
58
59
60
61
# File 'lib/vcenter_driver.rb', line 52

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 error_message("Couldn't load vcenterrc. \
                                   Reason #{e.message}.")
    end
end