aboutsummaryrefslogtreecommitdiffstats
path: root/lib/toaster/toastermain/management/commands/builddelete.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/toaster/toastermain/management/commands/builddelete.py')
-rw-r--r--lib/toaster/toastermain/management/commands/builddelete.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/toaster/toastermain/management/commands/builddelete.py b/lib/toaster/toastermain/management/commands/builddelete.py
index 0bef8d410..93919dec2 100644
--- a/lib/toaster/toastermain/management/commands/builddelete.py
+++ b/lib/toaster/toastermain/management/commands/builddelete.py
@@ -1,17 +1,23 @@
-from django.core.management.base import BaseCommand, CommandError
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from django.core.management.base import BaseCommand
from django.core.exceptions import ObjectDoesNotExist
from orm.models import Build
from django.db import OperationalError
-import os
-
class Command(BaseCommand):
args = '<buildID1 buildID2 .....>'
help = "Deletes selected build(s)"
+ def add_arguments(self, parser):
+ parser.add_argument('buildids', metavar='N', type=int, nargs='+',
+ help="Build ID's to delete")
+
def handle(self, *args, **options):
- for bid in args:
+ for bid in options['buildids']:
try:
b = Build.objects.get(pk = bid)
except ObjectDoesNotExist: