blob: 8d301bf78613daadc38e3a7cb5dbb1bade87cc50 [file] [log] [blame]
#!/usr/bin/python2
import os, sys, shutil
thisdir = os.path.dirname(os.path.abspath(sys.argv[0]))
sys.path.insert(0, os.path.abspath(os.path.join(thisdir, '../tko')))
import db
usage = "usage: delete_job_results <job tag>"
if len(sys.argv) < 2:
print usage
sys.exit(2)
tag = sys.argv[1]
resultsdir = os.path.abspath(os.path.join(thisdir, '../results', tag))
db = db.db()
if not db.find_job(tag):
raise "Job tag %s does not exist in database" % tag
db.delete_job(tag)
shutil.rmtree(resultsdir)