All pastes #1957649 Raw Edit

Someone

public text v1 · immutable
#1957649 ·published 2010-10-08 16:37 UTC
rendered paste body
    def initialize(config_file)
        
        # --- Load the Cloud Server configuration file ---

        @config = Configuration.new(config_file)

        if @config[:vm_type] == nil
            raise "No VM_TYPE defined."
        end
        
        @instance_types = Hash.new

        if @config[:vm_type].kind_of?(Array)
            @config[:vm_type].each {|type|
                @instance_types[type['NAME']]=type
            }
        else
            @instance_types[@config[:vm_type]['NAME']]=@config[:vm_type]
        end

        # --- Start an OpenNebula Session ---

        @one_client = Client.new(nil,@config[:one_xmlrpc])
        @user_pool  = UserPool.new(@one_client)
        
        @img_repo = OpenNebula::ImageRepository.new
    end