Skip to content

Commit

Permalink
fix: prefix path separators on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
keithmanville committed Aug 3, 2023
1 parent 9b690ad commit aee2433
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/dioptra/restapi/task_plugin/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit aee2433

Please sign in to comment.