Skip to content

Commit

Permalink
Fix dstack rm fail
Browse files Browse the repository at this point in the history
  • Loading branch information
r4victor committed Aug 10, 2023
1 parent 9835034 commit c412c83
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cli/dstack/_internal/cli/commands/rm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ def _command(self, args: Namespace):
and (args.yes or Confirm.ask(f"[red]Delete the run '{args.run_name}'?[/]"))
) or (args.all and (args.yes or Confirm.ask("[red]Delete all runs?[/]"))):
hub_client = get_hub_client(project_name=args.project)
run_heads = hub_client.list_runs(args.run_name)
if len(run_heads) == 0 and args.run_name:
run_infos = hub_client.list_runs(args.run_name)
if len(run_infos) == 0 and args.run_name:
console.print(f"Cannot find the run '{args.run_name}'")
exit(1)
for run_head in run_heads:
hub_client.delete_run(run_head.run_name)
for run_info in run_infos:
hub_client.delete_run(run_info.run_head.run_name)
console.print(f"[grey58]OK[/]")
else:
if not args.run_name and not args.all:
Expand Down

0 comments on commit c412c83

Please sign in to comment.