mirror of
https://github.com/newnius/YAO-agent.git
synced 2025-12-13 05:26:43 +00:00
update, add dfs
This commit is contained in:
6
agent.py
6
agent.py
@@ -17,6 +17,7 @@ import docker
|
|||||||
from urllib import parse
|
from urllib import parse
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
ClientID = os.getenv('ClientID', 1)
|
ClientID = os.getenv('ClientID', 1)
|
||||||
ClientHost = os.getenv('ClientHost', "localhost")
|
ClientHost = os.getenv('ClientHost', "localhost")
|
||||||
@@ -190,7 +191,10 @@ class MyHandler(BaseHTTPRequestHandler):
|
|||||||
token = generate_token(16)
|
token = generate_token(16)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.mkdir(docker_dfs_src)
|
# Docker wouldn't create dir by default on bind mode,
|
||||||
|
# see https://github.com/moby/moby/issues/13121
|
||||||
|
path = Path(docker_dfs_src)
|
||||||
|
path.mkdir(parents=True, exist_ok=True)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
print("Creation of the directory %s failed" % docker_dfs_src)
|
print("Creation of the directory %s failed" % docker_dfs_src)
|
||||||
print(e)
|
print(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user