def _stop_agent(self):
    agent_dir = os.path.join(self.get_path(), 'datastax-agent')
    if os.path.exists(agent_dir):
        pidfile = os.path.join(agent_dir, 'datastax-agent.pid')
    if os.path.exists(pidfile):
        with open(pidfile, 'r') as f:
            pid = int(f.readline().strip())
            f.close()
        if (pid is not None):
            try:
                os.kill(pid, signal.SIGKILL)
            except OSError:
                pass
        os.remove(pidfile)
def _stop_agent(self):
    agent_dir = os.path.join(self.get_path(), 'datastax-agent')
    if os.path.exists(agent_dir):
        pidfile = os.path.join(agent_dir, 'datastax-agent.pid')
    if os.path.exists(pidfile):
        with open(pidfile, 'r') as f:
            pid = int(f.readline().strip())
            f.close()
        if (pid is not None):
            try:
                os.kill(pid, signal.SIGKILL)
            except OSError:
                pass
        os.remove(pidfile)