提交 dea46093 编写于 作者: S shenyuhan

add note ip_addr field

上级 07670d78
......@@ -16,6 +16,7 @@ import os
import requests
import time
import paddle
import socket
from random import randint, seed
......@@ -35,10 +36,14 @@ def get_stat_server():
def hub_stat(argv):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('bj.bcebos.com', 80))
ip_addr = s.getsockname()[0]
params = {
'command': ' '.join(argv),
'hub_version': version.hub_version,
'paddle_version': paddle.__version__
'paddle_version': paddle.__version__,
'ip_addr': ip_addr
}
stat_api = get_stat_server()
r = requests.get(stat_api, params=params, timeout=0.5)
......
......@@ -116,7 +116,8 @@ class LocalModuleManager(object):
print_progress=True)
if module_dir:
with open(os.path.join(MODULE_HOME, module_dir, "md5.txt"), "w") as fp:
with open(os.path.join(MODULE_HOME, module_dir, "md5.txt"), "w"
) as fp:
fp.write(md5_value)
save_path = os.path.join(MODULE_HOME, module_name)
if os.path.exists(save_path):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册