summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastermain/management/commands/builddelete.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastermain/management/commands/builddelete.py')
-rw-r--r--bitbake/lib/toaster/toastermain/management/commands/builddelete.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/toastermain/management/commands/builddelete.py b/bitbake/lib/toaster/toastermain/management/commands/builddelete.py
index 343d3114c0..ff93e549df 100644
--- a/bitbake/lib/toaster/toastermain/management/commands/builddelete.py
+++ b/bitbake/lib/toaster/toastermain/management/commands/builddelete.py
@@ -1,4 +1,5 @@
1from django.core.management.base import BaseCommand, CommandError 1from django.core.management.base import BaseCommand, CommandError
2from django.core.exceptions import ObjectDoesNotExist
2from orm.models import Build 3from orm.models import Build
3from django.db import OperationalError 4from django.db import OperationalError
4import os 5import os
@@ -6,12 +7,16 @@ import os
6 7
7 8
8class Command(BaseCommand): 9class Command(BaseCommand):
9 args = "buildId" 10 args = '<buildID1 buildID2 .....>'
10 help = "Deletes selected build(s)" 11 help = "Deletes selected build(s)"
11 12
12 def handle(self, buildId, *args, **options): 13 def handle(self, *args, **options):
13 for bid in buildId.split(","): 14 for bid in args:
14 b = Build.objects.get(pk = bid) 15 try:
16 b = Build.objects.get(pk = bid)
17 except ObjectDoesNotExist:
18 print 'build %s does not exist, skipping...' %(bid)
19 continue
15 # theoretically, just b.delete() would suffice 20 # theoretically, just b.delete() would suffice
16 # however SQLite runs into problems when you try to 21 # however SQLite runs into problems when you try to
17 # delete too many rows at once, so we delete some direct 22 # delete too many rows at once, so we delete some direct