Skip to content

Commit

Permalink
[CLI] Disable --ip with --refresh when calling sky status to av…
Browse files Browse the repository at this point in the history
…oid additional empty lines in output (#2691)

* add

* lint

* Update sky/cli.py

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* lint

---------

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>
  • Loading branch information
cblmemo and concretevitamin authored Oct 21, 2023
1 parent 992a44d commit 0dc5b32
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sky/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1691,6 +1691,10 @@ def status(all: bool, refresh: bool, ip: bool, show_spot_jobs: bool,
If CLUSTERS is given, show those clusters. Otherwise, show all clusters.
If --ip is specified, show the IP address of the head node of the cluster.
Only available when CLUSTERS contains exactly one cluster, e.g.
``sky status --ip mycluster``.
The following fields for each cluster are recorded: cluster name, time
since last launch, resources, region, zone, hourly price, status, autostop,
command.
Expand Down Expand Up @@ -1751,6 +1755,10 @@ def status(all: bool, refresh: bool, ip: bool, show_spot_jobs: bool,
limit_num_jobs_to_show=not all,
is_called_by_user=False))
if ip:
if refresh:
raise click.UsageError(
'Using --ip with --refresh is not supported for now. '
'To fix, refresh first, then query the IP.')
if len(clusters) != 1:
with ux_utils.print_exception_no_traceback():
plural = 's' if len(clusters) > 1 else ''
Expand Down

0 comments on commit 0dc5b32

Please sign in to comment.