Exemple #1
0
 def delete(selected):
     stoppable = [
         run for run in selected
         if run.status == "running" and not run.remote
     ]
     if stoppable and not args.yes:
         cli.out("WARNING: one or more runs are still running "
                 "and will be stopped before being deleted.")
         if not cli.confirm("Really delete these runs?"):
             return
     for run in stoppable:
         _stop_run(run, no_wait=True)
     var.delete_runs(selected, args.permanent)
     if args.permanent:
         cli.out("Permanently deleted %i run(s)" % len(selected))
     else:
         cli.out("Deleted %i run(s)" % len(selected))
Exemple #2
0
 def delete(selected):
     stoppable = [
         run for run in selected
         if run.status == "running" and not run.remote
     ]
     if stoppable and not args.yes:
         cli.out(
             cmd_impl_support.format_warn(
                 "WARNING: One or more runs are still running "
                 "and will be stopped before being deleted."),
             err=True,
         )
         if not cli.confirm("Really delete these runs?"):
             raise SystemExit(exit_code.ABORTED)
     for run in stoppable:
         _stop_run(run, no_wait=True)
     var.delete_runs(selected, args.permanent)
     if args.permanent:
         cli.out("Permanently deleted %i run(s)" % len(selected), err=True)
     else:
         cli.out("Deleted %i run(s)" % len(selected), err=True)
Exemple #3
0
 def delete(self, permanent=False):
     runs = self._runs()
     var.delete_runs(runs, permanent)
     return [run.id for run in runs]
Exemple #4
0
 def delete(selected):
     var.delete_runs(selected, args.permanent)
     if args.permanent:
         cli.out("Permanently deleted %i run(s)" % len(selected))
     else:
         cli.out("Deleted %i run(s)" % len(selected))