From 25e90b2e5b2d96602b5e3c83fa663c9ab09b9892 Mon Sep 17 00:00:00 2001 From: Thomas Sundvoll Date: Wed, 13 Mar 2024 14:17:44 +0100 Subject: [PATCH] Refer to blob storage in inspection result message when sending over MQTT Co-authored-by: Mariana R. Santos --- src/isar/storage/blob_storage.py | 2 +- src/isar/storage/utilities.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/isar/storage/blob_storage.py b/src/isar/storage/blob_storage.py index a7806a04..ba9bc10a 100644 --- a/src/isar/storage/blob_storage.py +++ b/src/isar/storage/blob_storage.py @@ -55,7 +55,7 @@ def _upload_file(self, path: Path, data: bytes) -> str: except Exception as e: self.logger.error("An unexpected error occurred while uploading blob") raise StorageException from e - return blob_properties["etag"] + return blob_client.blob_name def _get_blob_service_client(self) -> BlobServiceClient: try: diff --git a/src/isar/storage/utilities.py b/src/isar/storage/utilities.py index 555c2e07..1708d377 100644 --- a/src/isar/storage/utilities.py +++ b/src/isar/storage/utilities.py @@ -79,4 +79,5 @@ def get_filename( def get_foldername(mission: Mission) -> str: - return f"{datetime.utcnow().date()}__{settings.PLANT_SHORT_NAME}__{mission.name}__{mission.id}" + mission_name: str = mission.name.replace(" ", "-") + return f"{datetime.utcnow().date()}__{settings.PLANT_SHORT_NAME}__{mission_name}__{mission.id}"