diff options
author | gasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2015-03-17 16:36:46 +0000 |
---|---|---|
committer | gasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2015-03-17 16:36:46 +0000 |
commit | 70b899365a062d1fcb17afc3f34360cafea21a0e (patch) | |
tree | 34c84d367900d7a053d0cf9a0010aca38b9189fd /kpov_judge | |
parent | 4df70266cf670f5f12f3219b18e59b7aaafaf1b0 (diff) |
Added rm_task.py
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@289 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge')
-rwxr-xr-x | kpov_judge/rm_task.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/kpov_judge/rm_task.py b/kpov_judge/rm_task.py new file mode 100755 index 0000000..e4b37c7 --- /dev/null +++ b/kpov_judge/rm_task.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import pymongo +from bson.son import SON +from bson import Binary +import sys +import inspect +import kpov_random_helpers +import settings +import glob +import os + + +if __name__ == '__main__': + if len(sys.argv) < 2: + print u"Usage: {0} [task_name]".format(sys.argv[0]) + exit(1) + task_id = sys.argv[1] + db = pymongo.Connection(settings.DB_HOST).kpov + try: + db.authenticate(settings.USERNAME, settings.PASSWORD) + except Exception, e: + print "Not authenticated:"+str(e) + #no auth or auth config? + db.computers_meta.remove({'task_id': task_id}) + db.networks.remove({'task_id': task_id}) + db.task_checkers.remove({'task_id': task_id}) + db.tasks.remove({'task_id': task_id}) + db.prepare_disks.remove({'task_id': task_id}) + db.gen_params.remove({'task_id': task_id}) + db.task_params_meta.remove({'task_id': task_id}) + db.task_instructions.remove({'task_id': task_id}) + db.howtos.remove({'task_id': task_id}) + db.howto_images.remove({'task_id': task_id}) |