Class: Bosh::Director::DnsManagerProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/dns/dns_manager.rb

Class Method Summary collapse

Class Method Details

.createObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/bosh/director/dns/dns_manager.rb', line 3

def self.create
  dns_enabled = !!Config.dns_db # to be consistent with current behavior
  if dns_enabled
    dns_config = Config.dns || {}
    logger = Config.logger
    local_dns_repo = LocalDnsRepo.new(logger)
    dns_domain_name = Canonicalizer.canonicalize(dns_config.fetch('domain_name', 'bosh'), :allow_dots => true)
    dns_provider = PowerDns.new(dns_domain_name, logger)

    EnabledDnsManager.new(dns_domain_name, dns_config, dns_provider, local_dns_repo, logger)
  else
    DisabledDnsManager.new
  end
end