~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/lib/sys_mgmt/system_management.py

  • Committer: Mark Atwood
  • Date: 2011-06-04 22:59:55 UTC
  • mfrom: (2318.1.1 dbqp_bugfix)
  • Revision ID: me@mark.atwood.name-20110604225955-6e1lkh0yu15v63fz
mergeĀ lp:~patrick-crews/drizzle/bug788394

Show diffs side-by-side

added added

removed removed

Lines of Context:
580
580
                    self.logging.info("Killing pid %s from %s" %( pid
581
581
                                                                , file_path
582
582
                                                                ))
583
 
                    self.execute_cmd("kill -9 %s" %pid, must_pass=0)
 
583
                    self.kill_pid(pid)
584
584
        if exit:
585
585
            sys.exit(0)
586
586
 
 
587
    def find_pid(self, pid):
 
588
        """ Execute ps and see if we find the pid """
 
589
 
 
590
        cmd = "ps"
 
591
        retcode, output = self.execute_cmd(cmd)
 
592
        output = output.split('\n')
 
593
        for line in output:
 
594
            found_pid = line.strip().split(' ')
 
595
            if str(pid) == pid:
 
596
                return True
 
597
        return False
 
598
 
 
599
    def kill_pid(self, pid):
 
600
        """ We kill the specified pid """
 
601
        
 
602
        self.execute_cmd("kill -9 %s" %pid, must_pass=0)
 
603
 
587
604
   
588
605
    
589
606