method is called to kill a running process

def _kill_process(self, box_config):
        """ method is called to kill a running process """
        try:
            self.logger.info('kill: {0} {{'.format(box_config.process_name))
            self.logger.info('target process pid={0}'.format(box_config.pid))
            if box_config.pid and psutil.pid_exists(box_config.pid):
                p = psutil.Process(box_config.pid)
                p.kill()
                p.wait()
                box_config.pid = None
                self.bc_dao.update(box_config)
                remove_pid_file(box_config.process_name)
        except Exception:
            self.logger.error('Exception on killing: {0}'.format(box_config.process_name), exc_info=True)
        finally:
            self.logger.info('}')