From b236fc41a994980265d8509a8b56fb459ea719b3 Mon Sep 17 00:00:00 2001 From: xianglic Date: Tue, 22 Oct 2024 18:40:34 +0000 Subject: [PATCH] revising the supervisor for the nested download --- onboard/python/supervisor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/onboard/python/supervisor.py b/onboard/python/supervisor.py index 2582038..30a396a 100644 --- a/onboard/python/supervisor.py +++ b/onboard/python/supervisor.py @@ -148,12 +148,14 @@ def download(self, url: str): os.makedirs(self.drone_id, exist_ok=True) z = ZipFile(filename) sys.path.append(self.drone_id) + os.chdir(self.drone_id) try: subprocess.check_call(['rm', '-rf', './task_defs', './mission', './transition_defs']) except subprocess.CalledProcessError as e: logger.debug(f"Error removing old task/transition defs: {e}") z.extractall() self.install_prereqs() + os.chdir('..') except Exception as e: print(e)