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:
6
agent.py
6
agent.py
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user