From 70b899365a062d1fcb17afc3f34360cafea21a0e Mon Sep 17 00:00:00 2001 From: "gasperfele@fri1.uni-lj.si" Date: Tue, 17 Mar 2015 16:36:46 +0000 Subject: 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 --- kpov_judge/rm_task.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 kpov_judge/rm_task.py (limited to 'kpov_judge') 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}) -- cgit v1.2.1