Skip to content

Commit

Permalink
utils: create full user_workspace_path stored in the database
Browse files Browse the repository at this point in the history
  • Loading branch information
marcdiazsan committed Aug 9, 2021
1 parent b5c84d9 commit 6c66eb7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The list of contributors in alphabetical order:
- `Adelina Lintuluoto <https://orcid.org/0000-0002-0726-1452>`_
- `Audrius Mecionis <https://orcid.org/0000-0002-3759-1663>`_
- `Anton Khodak <https://orcid.org/0000-0003-3263-4553>`_
- `Camila Diaz <https://orcid.org/0000-0001-5543-797X>`_
- `Diego Rodriguez <https://orcid.org/0000-0003-0649-2002>`_
- `Dinos Kousidis <https://orcid.org/0000-0002-4914-4289>`_
- `Harri Hirvonsalo <https://orcid.org/0000-0002-5503-510X>`_
Expand Down
9 changes: 5 additions & 4 deletions reana_server/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import re
import secrets
import sys
import os
from uuid import UUID, uuid4

import click
Expand All @@ -23,7 +24,7 @@
import yaml
from flask import current_app as app, url_for
from jinja2 import Environment, PackageLoader, select_autoescape
from reana_commons.config import REANAConfig
from reana_commons.config import REANAConfig, REANA_WORKFLOW_UMASK
from reana_commons.email import send_email
from reana_commons.k8s.secrets import REANAUserSecretsStore
from reana_commons.yadage import yadage_load_from_workspace
Expand Down Expand Up @@ -63,9 +64,9 @@ def is_uuid_v4(uuid_or_name):

def create_user_workspace(user_workspace_path):
"""Create user workspace directory."""
reana_fs = fs.open_fs(app.config["SHARED_VOLUME_PATH"])
if not reana_fs.exists(user_workspace_path):
reana_fs.makedirs(user_workspace_path)
if not os.path.isdir(user_workspace_path):
os.umask(REANA_WORKFLOW_UMASK)
os.makedirs(user_workspace_path, exist_ok=True)


def get_user_from_token(access_token):
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ python-dateutil==2.8.1 # via alembic, bravado, bravado-core, kubernetes
python-editor==1.0.4 # via alembic
pytz==2021.1 # via babel, bravado-core, celery, fs
pyyaml==5.4.1 # via bravado, bravado-core, kubernetes, packtivity, reana-commons, swagger-spec-validator, yadage, yadage-schemas
reana-commons[kubernetes,yadage]==0.8.0a20 # via reana-db, reana-server (setup.py)
reana-db==0.8.0a19 # via reana-server (setup.py)
reana-commons[kubernetes,yadage]==0.8.0a21 # via reana-db, reana-server (setup.py)
reana-db==0.8.0a20 # via reana-server (setup.py)
redis==3.5.3 # via invenio-accounts, invenio-celery
requests-oauthlib==1.1.0 # via flask-oauthlib, invenio-oauth2server, invenio-oauthclient, kubernetes
requests[security]==2.20.0 # via bravado, kubernetes, packtivity, reana-server (setup.py), requests-oauthlib, yadage, yadage-schemas
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
history = open("CHANGES.rst").read()

tests_require = [
"pytest-reana>=0.8.0a5,<0.9.0",
"pytest-reana>=0.8.0a6,<0.9.0",
]

extras_require = {
Expand Down Expand Up @@ -48,8 +48,8 @@
install_requires = [
"marshmallow>2.13.0,<=2.20.1",
"pyOpenSSL==17.5.0",
"reana-commons[kubernetes,yadage]>=0.8.0a20,<0.9.0",
"reana-db>=0.8.0a19,<0.9.0",
"reana-commons[kubernetes,yadage]>=0.8.0a21,<0.9.0",
"reana-db>=0.8.0a20,<0.9.0",
"requests==2.20.0",
"rfc3987==1.3.7",
"strict-rfc3339==0.7",
Expand Down

0 comments on commit 6c66eb7

Please sign in to comment.