1
0
mirror of https://github.com/newnius/YAO-agent.git synced 2025-12-12 21:16:44 +00:00

bugfix, make sure dfs dir is created

This commit is contained in:
2020-12-09 11:25:31 +08:00
parent 86c1ba01c6
commit a8fd76ac05

View File

@@ -303,13 +303,17 @@ class MyHandler(BaseHTTPRequestHandler):
while True:
failed_cnt += 1
if failed_cnt > 3:
print("[ERROR] unable to create dfs dir %s" % dfs_src)
break
try:
# Docker wouldn't create dir by default on bind mode,
# see https://github.com/moby/moby/issues/13121
path = Path(dfs_src)
path.mkdir(parents=True, exist_ok=True)
break
if path.exists():
break
else:
time.sleep(1)
except OSError as e:
print("Creation of the directory %s failed" % dfs_src)
print(e)