cockpit: new project uses ~/pipeline_ws as workspace base
This commit is contained in:
parent
d0a801f283
commit
abf5e82945
@ -658,18 +658,18 @@ if action == 'send_message':
|
|||||||
await _save_context(sor, uid, proj.id, '')
|
await _save_context(sor, uid, proj.id, '')
|
||||||
else:
|
else:
|
||||||
pid = getID()
|
pid = getID()
|
||||||
# 创建工作目录:检测 /d 可写性,不可写时回退 /tmp/pipeline_ws
|
# 创建工作目录:优先 ~/pipeline_ws,不可写时回退
|
||||||
ws_base = '/d/pipeline/workspaces'
|
ws_base = os.path.expanduser('~/pipeline_ws')
|
||||||
try:
|
try:
|
||||||
if not os.path.isdir(os.path.dirname(ws_base)) or not os.access(os.path.dirname(ws_base), os.W_OK):
|
os.makedirs(ws_base, exist_ok=True)
|
||||||
ws_base = '/tmp/pipeline_ws'
|
|
||||||
except Exception:
|
except Exception:
|
||||||
ws_base = '/tmp/pipeline_ws'
|
ws_base = '/tmp/pipeline_ws'
|
||||||
|
os.makedirs(ws_base, exist_ok=True)
|
||||||
ws_dir = f"{ws_base}/{org_id}/{pname}"
|
ws_dir = f"{ws_base}/{org_id}/{pname}"
|
||||||
try:
|
try:
|
||||||
os.makedirs(ws_dir, exist_ok=True)
|
os.makedirs(ws_dir, exist_ok=True)
|
||||||
except Exception:
|
except Exception:
|
||||||
ws_dir = f"/tmp/pipeline_ws/{pname}"
|
ws_dir = os.path.expanduser(f'~/pipeline_ws/{pname}')
|
||||||
os.makedirs(ws_dir, exist_ok=True)
|
os.makedirs(ws_dir, exist_ok=True)
|
||||||
await sor.C('sd_projects', {
|
await sor.C('sd_projects', {
|
||||||
'id': pid, 'name': pname, 'description': intent.get('description', ''),
|
'id': pid, 'name': pname, 'description': intent.get('description', ''),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user