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 <[email protected]> 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:
