def _resolve_cell_from_dns(self, cellname): """Resolve Zookeeper connection string from DNS.""" if not self.dns_domain: _LOGGER.warn('DNS domain is not set.') zkurl_rec = dnsutils.txt('zk.%s' % (cellname)) else: zkurl_rec = dnsutils.txt('zk.%s.%s' % (cellname, self.dns_domain)) if zkurl_rec: self.cell = cellname self.zk.url = zkurl_rec[0] return bool(self.zk.url)
def _zk_url(ctx): """Resolve Zookeeper connection string from DNS.""" if not ctx.dns_domain: _LOGGER.warning('DNS domain is not set.') zkurl_rec = dnsutils.txt('zk.%s' % (ctx.cell), ctx.dns_server) else: zkurl_rec = dnsutils.txt('zk.%s.%s' % (ctx.cell, ctx.dns_domain), ctx.dns_server) if zkurl_rec: return zkurl_rec[0] else: return None
def _tktfwd_spn(dns_domain): """Return tktfwd SPN for given dns domain.""" tktfwd_rec = dnsutils.txt('tktfwd.%s' % (dns_domain), context.GLOBAL.dns_server) if tktfwd_rec: return tktfwd_rec[0] else: return None