Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvll committed Dec 12, 2022
1 parent cfd8ff3 commit e6c7b0c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions sky/backends/backend_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1842,14 +1842,12 @@ def _is_local_cluster(record):
f'[bold cyan]Refreshing status for {len(records)} cluster{plural}[/]',
total=len(records))

failed_clusters = []

def _refresh_cluster(cluster_name):
try:
record = _update_cluster_status(
cluster_name, acquire_per_cluster_status_lock=True)
except exceptions.ClusterStatusFetchingError as e:
failed_clusters.append((cluster_name, e))
record = {'status': 'UNKNOWN', 'error': e}
progress.update(task, advance=1)
return record

Expand All @@ -1859,13 +1857,19 @@ def _refresh_cluster(cluster_name):
_refresh_cluster, cluster_names)

# Show information for removed clusters.
autodown_clusters, remaining_clusters = [], []
normal_updated_records = []
autodown_clusters, remaining_clusters, failed_clusters = [], [], []
for i, record in enumerate(records):
if updated_records[i] is None:
if record['to_down']:
autodown_clusters.append(cluster_names[i])
else:
remaining_clusters.append(cluster_names[i])
elif updated_records[i]['status'] == 'UNKNOWN':
failed_clusters.append(
(cluster_names[i], updated_records[i]['error']))
else:
normal_updated_records.append(updated_records[i])

yellow = colorama.Fore.YELLOW
bright = colorama.Style.BRIGHT
Expand All @@ -1890,11 +1894,7 @@ def _refresh_cluster(cluster_name):
table.add_row([cluster_name, str(e)])
logger.warning([f'\t{row}' for row in str(table).split('\n')])

# Filter out removed clusters.
updated_records = [
record for record in updated_records if record is not None
]
return updated_records
return normal_updated_records


def get_backend_from_handle(
Expand Down

0 comments on commit e6c7b0c

Please sign in to comment.