Revision 8cd7d0df src/vmm_mad/remotes/ec2/ec2_driver.rb

View differences:

src/vmm_mad/remotes/ec2/ec2_driver.rb
273 273
    # to retrieve connection information
274 274
    # needed for Amazon
275 275
    def get_connect_info(host)
276

  
277 276
        conn_opts={}
278 277

  
279 278
        client   = OpenNebula::Client.new
......
284 283

  
285 284
        system = OpenNebula::System.new(client)
286 285
        config = system.get_configuration
287
        if OpenNebula.is_error?(config)
288
            puts "Error getting oned configuration : #{config.message}"
289
            exit -1
290
        end
286
        raise "Error getting oned configuration : #{config.message}" if OpenNebula.is_error?(config)
287

  
291 288
        token = config["ONE_KEY"]
292 289

  
293 290
        conn_opts = {
294 291
            :access => xmlhost["TEMPLATE/EC2_ACCESS"],
295 292
            :secret => xmlhost["TEMPLATE/EC2_SECRET"]
296 293
        }
294

  
297 295
        begin
298 296
            conn_opts = OpenNebula.decrypt(conn_opts, token)
299 297
            conn_opts[:region] = xmlhost["TEMPLATE/REGION_NAME"]
......
479 477
                totalmemory += mem * value.to_i
480 478
                totalcpu    += cpu * value.to_i
481 479
            }
480
        else
481
            raise "you must define CAPACITY section properly! check the template"
482 482
        end
483 483

  
484 484
        host_info =  "HYPERVISOR=ec2\n"

Also available in: Unified diff