mirror of
https://github.com/newnius/YAO-agent.git
synced 2025-12-15 05:56:43 +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:
|
while True:
|
||||||
failed_cnt += 1
|
failed_cnt += 1
|
||||||
if failed_cnt > 3:
|
if failed_cnt > 3:
|
||||||
|
print("[ERROR] unable to create dfs dir %s" % dfs_src)
|
||||||
break
|
break
|
||||||
try:
|
try:
|
||||||
# Docker wouldn't create dir by default on bind mode,
|
# Docker wouldn't create dir by default on bind mode,
|
||||||
# see https://github.com/moby/moby/issues/13121
|
# see https://github.com/moby/moby/issues/13121
|
||||||
path = Path(dfs_src)
|
path = Path(dfs_src)
|
||||||
path.mkdir(parents=True, exist_ok=True)
|
path.mkdir(parents=True, exist_ok=True)
|
||||||
break
|
if path.exists():
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
time.sleep(1)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
print("Creation of the directory %s failed" % dfs_src)
|
print("Creation of the directory %s failed" % dfs_src)
|
||||||
print(e)
|
print(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user