Ejemplo n.º 1
0
    def _remove_analysis(self):
        analysis_id             = self.request_dict['analysis_id']

        p = Meta(analysis_id)

        if analysis_id in self.serverstate.running_analyses:
            self.serverstate.running_analyses.remove(analysis_id)
        if analysis_id in self.serverstate.done_analyses:
            self.serverstate.done_analyses.remove(analysis_id)

        helper_functions.move_or_delete(p.dirs.analysis_dir,c.trash_bin)
Ejemplo n.º 2
0
 def delete_resource(self):
     res = self.request_dict['resource']
     if res == 'analyses' or res == 'analysis':
         if self.request_dict.get('id'):
             self.request_dict['analysis_id'] = self.request_dict['id']
         self.remove_analysis()
     else:
         if(hasattr(c,res+'_dir')):
             helper_functions.move_or_delete(os.path.join(getattr(c,res+'_dir'),self.request_dict['id']), c.trash_bin)
             self.write_socket({'response':'OK'})
         else:
             error_log = os.path.join(c.error_logs_dir, time_stamp.__str__())
             traceback.print_exc(file=open(error_log, "w"))
             exception_info = open(error_log).read()
             self.write_socket({'response': 'error', 'exception': 'the requested resource does not exist'})
     return