def kill_drone():
global DRONE_RUNNING
LOG.info('stopping drone')
if DRONE_RUNNING is False:
LOG.warning('drone is not running, nothing to do')
return
LOG.info('trying to stop drone gracefully')
DRONE.terminate()
try:
DRONE.wait(timeout=10)
LOG.info('drone exited gracefully')
except subprocess.TimeoutExpired:
LOG.info('could not terminate drone properly, kill it.')
DRONE.kill()
DRONE.wait(timeout=10)
LOG.info('drone has been killed')
DRONE_RUNNING = False
评论列表
文章目录