mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
mavsdk_tests: don't forget to check for rootfs dir
This commit is contained in:
@@ -177,14 +177,15 @@ class Px4Runner(Runner):
|
||||
rootfs_path = self.cwd
|
||||
if self.verbose:
|
||||
print("Clearing rootfs (except logs): {}".format(rootfs_path))
|
||||
for item in os.listdir(rootfs_path):
|
||||
if item == 'log':
|
||||
continue
|
||||
path = os.path.join(rootfs_path, item)
|
||||
if os.path.isfile(path) or os.path.islink(path):
|
||||
os.remove(path)
|
||||
else:
|
||||
shutil.rmtree(path)
|
||||
if os.path.isdir(rootfs_path):
|
||||
for item in os.listdir(rootfs_path):
|
||||
if item == 'log':
|
||||
continue
|
||||
path = os.path.join(rootfs_path, item)
|
||||
if os.path.isfile(path) or os.path.islink(path):
|
||||
os.remove(path)
|
||||
else:
|
||||
shutil.rmtree(path)
|
||||
|
||||
def create_rootfs(self) -> None:
|
||||
rootfs_path = self.cwd
|
||||
|
||||
Reference in New Issue
Block a user