未验证 提交 c92b78b0 编写于 作者: W whs 提交者: GitHub

Fix unitest of light nas. (#18931)

test=develop
上级 e1b5833b
...@@ -82,15 +82,7 @@ class LightNASStrategy(Strategy): ...@@ -82,15 +82,7 @@ class LightNASStrategy(Strategy):
self._server_ip = self._get_host_ip() self._server_ip = self._get_host_ip()
def _get_host_ip(self): def _get_host_ip(self):
return socket.gethostbyname(socket.gethostname())
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('8.8.8.8', 80))
ip = s.getsockname()[0]
finally:
s.close()
return ip
def on_compression_begin(self, context): def on_compression_begin(self, context):
self._current_tokens = context.search_space.init_tokens() self._current_tokens = context.search_space.init_tokens()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册