def check_unauth(self, host, port): if self.flag: try: memcache = Client(server=(host, port), connect_timeout=self.timeout, timeout=self.timeout) version = memcache.version() except Exception as e: hook_msg((False, host, port, "Anonymous", "")) else: if version: hook_msg((True, host, port, "Anonymous", "")) self.unauth_result.append(host) finally: memcache.close()