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

[incubator-sdap-ingester] branch dev updated: add default case when collection path is a regex (#32)

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

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


The following commit(s) were added to refs/heads/dev by this push:
     new aeb1481  add default case when collection path is a regex (#32)
aeb1481 is described below

commit aeb14815424b7cdacba929d5f2474a486130769e
Author: thomas loubrieu <60...@users.noreply.github.com>
AuthorDate: Thu May 6 17:03:00 2021 -0700

    add default case when collection path is a regex (#32)
    
    Co-authored-by: thomas loubrieu <th...@jpl.nasa.gov>
---
 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: