Skip to content

Commit

Permalink
fix(cli): correct the comparison of upload status
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <me@frostming.com>
  • Loading branch information
frostming committed Apr 9, 2024
1 parent d0149af commit 5ef2be8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/bentoml/_internal/cloud/bentocloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def push_model(model: Model) -> None:
if (
not force
and remote_bento
and remote_bento.upload_status == BentoUploadStatus.SUCCESS
and remote_bento.upload_status == BentoUploadStatus.SUCCESS.value
):
self.spinner.log_progress.add_task(
f'[bold blue]Push skipped: Bento "{bento.tag}" already exists in remote Bento store'
Expand Down Expand Up @@ -394,7 +394,7 @@ def chunk_upload(
status=BentoUploadStatus.FAILED,
reason=str(e),
)
if finish_req.status is BentoUploadStatus.FAILED:
if finish_req.status == BentoUploadStatus.FAILED.value:
self.spinner.log_progress.add_task(
f'[bold red]Failed to upload Bento "{bento.tag}"'
)
Expand All @@ -406,7 +406,7 @@ def chunk_upload(
version=version,
req=finish_req,
)
if finish_req.status != BentoUploadStatus.SUCCESS:
if finish_req.status != BentoUploadStatus.SUCCESS.value:
self.spinner.log_progress.add_task(
f'[bold red]Failed pushing Bento "{bento.tag}": {finish_req.reason}'
)
Expand Down Expand Up @@ -633,7 +633,7 @@ def _do_push_model(
if (
not force
and remote_model
and remote_model.upload_status == ModelUploadStatus.SUCCESS
and remote_model.upload_status == ModelUploadStatus.SUCCESS.value
):
self.spinner.log_progress.add_task(
f'[bold blue]Model "{model.tag}" already exists in remote model store, skipping'
Expand Down Expand Up @@ -851,7 +851,7 @@ def chunk_upload(
status=ModelUploadStatus.FAILED,
reason=str(e),
)
if finish_req.status is ModelUploadStatus.FAILED:
if finish_req.status == ModelUploadStatus.FAILED.value:
self.spinner.log_progress.add_task(
f'[bold red]Failed to upload model "{model.tag}"'
)
Expand All @@ -864,7 +864,7 @@ def chunk_upload(
req=finish_req,
)

if finish_req.status != ModelUploadStatus.SUCCESS:
if finish_req.status != ModelUploadStatus.SUCCESS.value:
self.spinner.log_progress.add_task(
f'[bold red]Failed pushing model "{model.tag}" : {finish_req.reason}'
)
Expand Down

0 comments on commit 5ef2be8

Please sign in to comment.