Skip to content

Commit

Permalink
[CLI] Fix bugs when specify job_id in sky logs (#2662)
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
cblmemo authored Oct 5, 2023
1 parent e76f798 commit 4e227ce
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sky/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2072,10 +2072,13 @@ def logs(
assert job_ids is None or len(job_ids) <= 1, job_ids
job_id = None
if job_ids:
if not all(job_id.isdigit() for job_id in job_ids):
raise click.UsageError(f'Invalid job ID {", ".join(job_ids)}. '
# Already check that len(job_ids) <= 1. This variable is used later
# in core.tail_logs.
job_id = job_ids[0]
if not job_id.isdigit():
raise click.UsageError(f'Invalid job ID {job_id}. '
'Job ID must be integers.')
job_ids_to_query = [int(job_id) for job_id in job_ids]
job_ids_to_query = [int(job_id)]
else:
job_ids_to_query = job_ids
if status:
Expand Down

0 comments on commit 4e227ce

Please sign in to comment.