Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rosetta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ExaCT
Rosetta
Commits
d10d8d4d
Commit
d10d8d4d
authored
3 years ago
by
Stefano Alberto Russo
Browse files
Options
Downloads
Patches
Plain Diff
Fixes in the file manager API, including creating the base path user directory if not existent.
parent
a9a655a8
Loading
Loading
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
services/webapp/code/rosetta/core_app/api.py
+9
-3
9 additions, 3 deletions
services/webapp/code/rosetta/core_app/api.py
with
9 additions
and
3 deletions
services/webapp/code/rosetta/core_app/api.py
+
9
−
3
View file @
d10d8d4d
...
@@ -516,7 +516,10 @@ class FileManagerAPI(PrivateGETAPI, PrivatePOSTAPI):
...
@@ -516,7 +516,10 @@ class FileManagerAPI(PrivateGETAPI, PrivatePOSTAPI):
# Did we just get a "cannot stat - No such file or directory error?
# Did we just get a "cannot stat - No such file or directory error?
if
'
No such file or directory
'
in
out
.
stderr
:
if
'
No such file or directory
'
in
out
.
stderr
:
pass
if
path
==
'
/
'
:
self
.
mkdir
(
self
.
sanitize_and_prepare_shell_path
(
'
/
'
,
storage
,
user
),
user
,
storage
,
force
=
True
)
else
:
return
data
else
:
else
:
raise
Exception
(
out
.
stderr
)
raise
Exception
(
out
.
stderr
)
...
@@ -630,11 +633,14 @@ class FileManagerAPI(PrivateGETAPI, PrivatePOSTAPI):
...
@@ -630,11 +633,14 @@ class FileManagerAPI(PrivateGETAPI, PrivatePOSTAPI):
return
out
.
stdout
return
out
.
stdout
def
mkdir
(
self
,
path
,
user
,
storage
):
def
mkdir
(
self
,
path
,
user
,
storage
,
force
=
False
):
path
=
self
.
sanitize_and_prepare_shell_path
(
path
,
storage
,
user
)
path
=
self
.
sanitize_and_prepare_shell_path
(
path
,
storage
,
user
)
# Prepare command
# Prepare command
if
force
:
command
=
self
.
ssh_command
(
'
mkdir -p {}
'
.
format
(
path
),
user
,
storage
.
computing
)
else
:
command
=
self
.
ssh_command
(
'
mkdir {}
'
.
format
(
path
),
user
,
storage
.
computing
)
command
=
self
.
ssh_command
(
'
mkdir {}
'
.
format
(
path
),
user
,
storage
.
computing
)
# Execute_command
# Execute_command
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment