blob: f747510e1797d4ffebc5095e744daf7502deaf7e [file] [log] [blame]
mbligh96b9a5a2007-11-24 19:32:20 +00001#!/usr/bin/python
2import os, sys, shutil
3thisdir = os.path.dirname(os.path.abspath(sys.argv[0]))
4sys.path.insert(0, os.path.abspath(os.path.join(thisdir, '../tko')))
5import db
6
7usage = "usage: delete_job_results <job tag>"
8
9if len(sys.argv) < 2:
jadmanski0afbb632008-06-06 21:10:57 +000010 print usage
11 sys.exit(2)
mbligh96b9a5a2007-11-24 19:32:20 +000012tag = sys.argv[1]
13resultsdir = os.path.abspath(os.path.join(thisdir, '../results', tag))
14
mbligh96b9a5a2007-11-24 19:32:20 +000015db = db.db()
16if not db.find_job(tag):
jadmanski0afbb632008-06-06 21:10:57 +000017 raise "Job tag %s does not exist in database" % tag
mbligh96b9a5a2007-11-24 19:32:20 +000018
mbligh96b9a5a2007-11-24 19:32:20 +000019db.delete_job(tag)
mbligh7a41a862007-11-30 17:44:24 +000020shutil.rmtree(resultsdir)