module Torpedo::Orchestration::Helper

Public Class Methods

get_connection() click to toggle source
# File lib/torpedo/orchestration/helper.rb, line 14
def self.get_connection

  if ENV['DEBUG'] and ENV['DEBUG'] == 'true' then
    ENV['EXCON_DEBUG'] = 'true'
  end

  auth_url = ENV['OS_AUTH_URL']
  api_key = ENV['OS_PASSWORD']
  username = ENV['OS_USERNAME']
  authtenant = ENV['OS_TENANT_NAME']
  #region = ENV['OS_AUTH_REGION']
  service_type = ENV['HEAT_SERVICE_TYPE'] || "orchestration"
  service_name = ENV['HEAT_SERVICE_NAME'] #nil by default

  Fog::Orchestration.new(
    :provider           => :openstack,
    :openstack_auth_url  => auth_url+'/tokens',
    :openstack_username => username,
    :openstack_tenant => authtenant,
    :openstack_api_key => api_key,
    #:openstack_region => region,
    :openstack_service_type => service_type,
    :openstack_service_name => service_name
  )

end