From aee2433e9c60be95659880fb3e7616477feb2904 Mon Sep 17 00:00:00 2001 From: Keith Manville Date: Thu, 3 Aug 2023 20:47:02 +0000 Subject: [PATCH] fix: prefix path separators on windows --- src/dioptra/restapi/task_plugin/service.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/dioptra/restapi/task_plugin/service.py b/src/dioptra/restapi/task_plugin/service.py index e49455925..1bd0969ea 100644 --- a/src/dioptra/restapi/task_plugin/service.py +++ b/src/dioptra/restapi/task_plugin/service.py @@ -78,7 +78,7 @@ def create( plugin_uri_list: Optional[List[str]] = self._s3_service.upload_directory( directory=tmpdir, bucket=bucket, - prefix=str(prefix), + prefix=prefix.as_posix(), include_suffixes=[".py"], log=log, ) @@ -114,7 +114,11 @@ def delete( return [] prefix: Path = Path(collection) / task_plugin_name - self._s3_service.delete_prefix(bucket=bucket, prefix=str(prefix), log=log) + self._s3_service.delete_prefix( + bucket=bucket, + prefix=prefix.as_posix(), + log=log, + ) log.info( "TaskPlugin deleted", @@ -175,7 +179,7 @@ def get_by_name_in_collection( task_plugin_name=task_plugin_name, ) - prefix = Path(collection) / task_plugin_name + prefix: Path = Path(collection) / task_plugin_name modules: List[str] = self._s3_service.list_objects( bucket=bucket, prefix=self._s3_service.normalize_prefix(str(prefix), log=log),