Skip to content

Commit 1bae418

Browse files
l8556Nikolai Lambrov
andauthored
Enhance VM updater to delete existing archive before downloading from S3 (#315)
* Enhance VM updater to delete existing archive before downloading from S3 * Fix VmUpdater to use is_file() method for checking archive existence before download from S3 --------- Co-authored-by: Nikolai Lambrov <[email protected]>
1 parent 62f0d8e commit 1bae418

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

frameworks/vm_manager/vm_updater.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ def download(self) -> None:
282282
Download VM archive from S3.
283283
"""
284284
if not self.s3.is_exists_object(str(self.archive_path), self.s3_object_key):
285+
File.delete(str(self.archive_path), stdout=False) if self.archive_path.is_file() else None
285286
self.s3.download_file(self.s3_object_key, str(self.archive_path))
286287
self.__downloaded = True
287288
else:

0 commit comments

Comments
 (0)