fkie_node_manager: requests for name resolution
@@ -70,7 +70,6 @@ class MasterEntry(object):
return mastername in self._masternames
def has_address(self, address):
- with self.mutex:
return address in self._addresses
def add_mastername(self, mastername):
@@ -78,10 +77,10 @@ class MasterEntry(object):
self._masternames.insert(0, mastername)
def add_address(self, address):
+ with self.mutex:
if address and not self.has_address(address):
if self.is_legal_ip(address):
# it is an IP, try to get the hostname
- with self.mutex:
self._addresses.append(address)
# resolve the name in a thread
thread = Thread(target=self._get_hostname, args=((address,)))
@@ -89,7 +88,6 @@ class MasterEntry(object):
thread.start()
else:
# it is a hostname: add at the fist place and try to get an IP for this host
- with self.mutex:
self._addresses.insert(0, address)
# resolve the name in a thread
thread = Thread(target=self._get_address, args=((address,)))
