def run(self): global cid global pending_jobs #highly thread unsafe, but for now living with it. if self.sleep_time > 0: self.delay() #if not (kill or KILL_DICT[self.path]): if self.MASTER_ID != -1: #pending_jobs += 1 pending_jobs.append(self.path) self.wait_till_master() #pending_jobs -= 1 pending_jobs.remove(self.path) if not (kill or KILL_DICT[self.path]): cid.append(self.path) #print 'appended!!!!!!',self.path #print self.MASTER_ID sshOb = SSH(self.host,self.user,self.conf['pass']) self.pid,fd,success = sshOb.fork() #print '---------------',success #print fd if success: self.parent_processing(fd) else: cid.remove(self.path) DONE_HASH[self.JOB_ID] = True dead_jobs.add(self.path)