from .pidfile import PidFileError, InvalidPidFileError, PidFileInUseError, PidFile
-__version__ = '0.5.1'
+__version__ = '0.5.2'
LOG = logging.getLogger(__name__)
for m in self.re_split_addresses.split(value):
if m:
m = m.strip().lower()
+ LOG.debug("Checking given master address {!r} ...".format(m))
try:
addr_infos = socket.getaddrinfo(
m, 53, proto=socket.IPPROTO_TCP)
for addr_info in addr_infos:
+ addr = addr_info[4][0]
if not self.named_listen_on_v6 and addr_info[0] == socket.AF_INET6:
+ msg = (
+ "Not using {!r} as a master IP address, because "
+ "we are not using IPv6.").format(addr)
+ LOG.debug(msg)
continue
- addr = addr_info[4][0]
- if addr not in masters and addr not in self.local_addresses:
+ if addr in masters:
+ LOG.debug("Address {!r} already in masters yet.".format(addr))
+ else:
+ LOG.debug("Address {!r} not in masters yet.".format(addr))
masters.append(addr)
except socket.gaierror as e:
LOG.debug("Post init phase.")
+ LOG.debug("Checking for masters, which are local addresses ...")
+ ext_masters = []
+ for addr in self.zone_masters:
+ if addr in self.local_addresses:
+ LOG.debug(
+ "Address {!r} IS in list of local addresses.".format(addr))
+ else:
+ LOG.debug(
+ "Address {!r} not in list of local addresses.".format(addr))
+ ext_masters.append(addr)
+ self.zone_masters = ext_masters
+ LOG.info("Using list of masters for slave zones:\n{}".format(pp(self.zone_masters)))
+
self.pidfile = PidFile(
filename=self.pidfile_name, appname=self.appname, verbose=self.verbose,
base_dir=self.base_dir, simulate=self.simulate)