Loading services/webapp/code/rosetta/core_app/api.py +9 −3 Original line number Original line Diff line number Diff line Loading @@ -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) Loading Loading @@ -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 Loading Loading
services/webapp/code/rosetta/core_app/api.py +9 −3 Original line number Original line Diff line number Diff line Loading @@ -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) Loading Loading @@ -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 Loading