You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sdap.apache.org by tl...@apache.org on 2021/05/05 17:16:31 UTC

[incubator-sdap-ingester] branch watch_file_inregex_309 created (now 9477e49)

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

tloubrieu pushed a change to branch watch_file_inregex_309
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-ingester.git.


      at 9477e49  add default case when collection path is a regex

This branch includes the following new commits:

     new 9477e49  add default case when collection path is a regex

The 1 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.


[incubator-sdap-ingester] 01/01: add default case when collection path is a regex

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

tloubrieu pushed a commit to branch watch_file_inregex_309
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-ingester.git

commit 9477e49e50125a9e39879c45d3c8bae09485804b
Author: thomas loubrieu <th...@jpl.nasa.gov>
AuthorDate: Wed May 5 10:16:10 2021 -0700

    add default case when collection path is a regex
---
 collection_manager/collection_manager/services/CollectionWatcher.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/collection_manager/collection_manager/services/CollectionWatcher.py b/collection_manager/collection_manager/services/CollectionWatcher.py
index 68b013a..b713f2d 100644
--- a/collection_manager/collection_manager/services/CollectionWatcher.py
+++ b/collection_manager/collection_manager/services/CollectionWatcher.py
@@ -124,7 +124,10 @@ class CollectionWatcher:
     def _get_files_at_path(self, path: str) -> List[str]:
         if os.path.isfile(path):
             return [path]
-        return [f for f in glob(path + '/**', recursive=True) if os.path.isfile(f)]
+        elif os.path.isdir(path):
+            return [f for f in glob(path + '/**', recursive=True) if os.path.isfile(f)]
+        else:
+            return [f for f in glob(path, recursive=True) if os.path.isfile(f)]
 
     async def _reload_and_reschedule(self):
         try: