You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2021/07/29 18:15:11 UTC

[airavata-django-portal-sdk] branch master updated (b67bb33 -> ea4e68a)

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal-sdk.git.


    from b67bb33  AIRAVATA-3485 Bump version to 1.1.dev6
     new f835ec1  AIRAVATA-3420 bug fix: resource_path should be full path
     new 7d8a750  AIRAVATA-3485 Document the optional experiment_id parameter in user_storage API
     new ea4e68a  AIRAVATA-3485 Bump version to 1.1.dev7

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 airavata_django_portal_sdk/user_storage/api.py     | 30 ++++++++++++++++++----
 .../backends/django_filesystem_provider.py         |  2 +-
 setup.py                                           |  2 +-
 3 files changed, 27 insertions(+), 7 deletions(-)

[airavata-django-portal-sdk] 03/03: AIRAVATA-3485 Bump version to 1.1.dev7

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal-sdk.git

commit ea4e68a5649ebb3ac086013e7db4d8b623fd4e71
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Thu Jul 29 14:13:46 2021 -0400

    AIRAVATA-3485 Bump version to 1.1.dev7
---
 setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 39ffba9..f613d42 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ def read(fname):
 
 setup(
     name="airavata-django-portal-sdk",
-    version="1.1.dev6",
+    version="1.1.dev7",
     url="https://github.com/apache/airavata-django-portal-sdk",
     author="Apache Software Foundation",
     author_email="dev@airavata.apache.org",

[airavata-django-portal-sdk] 02/03: AIRAVATA-3485 Document the optional experiment_id parameter in user_storage API

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal-sdk.git

commit 7d8a750a68e8e34d8307364f59ff928af3102d27
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Thu Jul 29 14:01:00 2021 -0400

    AIRAVATA-3485 Document the optional experiment_id parameter in user_storage API
---
 airavata_django_portal_sdk/user_storage/api.py | 30 +++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/airavata_django_portal_sdk/user_storage/api.py b/airavata_django_portal_sdk/user_storage/api.py
index c548d42..c9194f2 100644
--- a/airavata_django_portal_sdk/user_storage/api.py
+++ b/airavata_django_portal_sdk/user_storage/api.py
@@ -75,7 +75,11 @@ def get_user_storage_provider(request, owner_username=None, storage_resource_id=
 
 
 def save(request, path, file, name=None, content_type=None, storage_resource_id=None, experiment_id=None):
-    "Save file in path in the user's storage and return DataProduct."
+    """
+    Save file in path in the user's storage and return DataProduct. If
+    `experiment_id` provided then the path will be relative to the experiment
+    data directory.
+    """
     if _is_remote_api():
         if name is None and hasattr(file, 'name'):
             name = os.path.basename(file.name)
@@ -273,7 +277,10 @@ def exists(request, data_product=None, data_product_uri=None):
 
 
 def dir_exists(request, path, storage_resource_id=None, experiment_id=None):
-    "Return True if path exists in user's data store."
+    """
+    Return True if path exists in user's data store. If `experiment_id` provided
+    then the path will be relative to the experiment data directory.
+    """
     if _is_remote_api():
         resp = _call_remote_api(request,
                                 "/user-storage/~/",
@@ -291,7 +298,10 @@ def dir_exists(request, path, storage_resource_id=None, experiment_id=None):
 
 
 def user_file_exists(request, path, storage_resource_id=None, experiment_id=None):
-    """If file exists, return data product URI, else None."""
+    """
+    If file exists, return data product URI, else None. If `experiment_id`
+    provided then the path will be relative to the experiment data directory.
+    """
     if _is_remote_api():
         resp = _call_remote_api(request,
                                 "/user-storage/~/{path}",
@@ -315,7 +325,10 @@ def user_file_exists(request, path, storage_resource_id=None, experiment_id=None
 
 
 def delete_dir(request, path, storage_resource_id=None, experiment_id=None):
-    """Delete path in user's data store, if it exists."""
+    """
+    Delete path in user's data store, if it exists. If `experiment_id` provided
+    then the path will be relative to the experiment data directory.
+    """
     if _is_remote_api():
         resp = _call_remote_api(request,
                                 "/user-storage/~/{path}",
@@ -497,7 +510,11 @@ def delete(request, data_product=None, data_product_uri=None):
 
 
 def listdir(request, path, storage_resource_id=None, experiment_id=None):
-    """Return a tuple of two lists, one for directories, the second for files."""
+    """
+    Return a tuple of two lists, one for directories, the second for files.  If
+    `experiment_id` provided then the path will be relative to the experiment
+    data directory.
+    """
 
     if _is_remote_api():
         resp = _call_remote_api(request,
@@ -649,6 +666,9 @@ def create_user_dir(request, path="", dir_names=(), create_unique=False, storage
     them for file paths, for example, converting spaces to underscores.  Returns
     a tuple of the storage_resource_id and resource_path of the directory
     resource.
+
+    If `experiment_id` provided then the path will be relative to the experiment
+    data directory.
     """
     if _is_remote_api():
         logger.debug(f"path={path}")

[airavata-django-portal-sdk] 01/03: AIRAVATA-3420 bug fix: resource_path should be full path

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal-sdk.git

commit f835ec1c0fd8babc998c67462d9a550a1f92bd1d
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Thu Jul 29 13:00:34 2021 -0400

    AIRAVATA-3420 bug fix: resource_path should be full path
---
 .../user_storage/backends/django_filesystem_provider.py                 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/airavata_django_portal_sdk/user_storage/backends/django_filesystem_provider.py b/airavata_django_portal_sdk/user_storage/backends/django_filesystem_provider.py
index 09bd680..fcb6f73 100644
--- a/airavata_django_portal_sdk/user_storage/backends/django_filesystem_provider.py
+++ b/airavata_django_portal_sdk/user_storage/backends/django_filesystem_provider.py
@@ -81,7 +81,7 @@ class DjangoFileSystemProvider(UserStorageProvider):
                 {
                     "name": os.path.basename(resource_path),
                     "path": datastore.rel_path(full_path),
-                    "resource_path": datastore.rel_path(full_path),
+                    "resource_path": full_path,
                     "created_time": created_time,
                     "size": size,
                 }