Sha256: a2848cdfecaf751b20710d633c408ee29f07ab6de2b8d99df563813f183cacf6

Contents?: true

Size: 1.13 KB

Versions: 56

Compression:

Stored size: 1.13 KB

Contents

require "rubber/dns/base.rb"

module Rubber
  module Dns

    def self.get_provider(provider, env)

      if provider == 'fog'
        # TODO: remove backwards compatibility in next major release
        
        provider_env = env.dns_providers['fog']
        puts "deprecated dns provider config: #{provider_env}"
        creds = provider_env.credentials
        real_provider = creds.provider
        require "rubber/dns/#{real_provider}"
        clazz = Rubber::Dns.const_get(real_provider.capitalize)
        case real_provider
          when 'aws'
            provider_env['access_key'] = creds['aws_access_key_id']
            provider_env['access_secret'] = creds['aws_secret_access_key']
          when 'zerigo'
            provider_env['email'] = creds['zerigo_email']
            provider_env['token'] = creds['zerigo_token']
        end
        return clazz.new(provider_env)
        
      else
        
        require "rubber/dns/#{provider}"
        clazz = Rubber::Dns.const_get(provider.capitalize)
        provider_env = env.dns_providers[provider]
        return clazz.new(provider_env)
        
      end
      
    end
    
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
rubber-2.5.0 lib/rubber/dns.rb
rubber-2.4.2 lib/rubber/dns.rb
rubber-2.4.1 lib/rubber/dns.rb
rubber-2.4.0 lib/rubber/dns.rb
rubber-2.3.1 lib/rubber/dns.rb
rubber-2.3.0 lib/rubber/dns.rb
rubber-2.2.4 lib/rubber/dns.rb
rubber-2.2.3 lib/rubber/dns.rb
rubber-2.2.2 lib/rubber/dns.rb
rubber-2.2.1 lib/rubber/dns.rb
rubber-2.2.0 lib/rubber/dns.rb
rubber-2.1.2 lib/rubber/dns.rb
rubber-2.1.1 lib/rubber/dns.rb
rubber-2.1.0 lib/rubber/dns.rb
rubber-2.0.8 lib/rubber/dns.rb
rubber-2.0.7 lib/rubber/dns.rb