i'm a dunce

This commit is contained in:
Darryl Nixon 2023-07-16 15:12:46 -07:00
parent 44595439ca
commit ef6a2cecc4

View file

@ -78,7 +78,8 @@ async def main(job: argparse.Namespace) -> bool:
tasks = []
# scandir/glob/rglob doesn't play nice with FileNotFound errors,
# so let's avoid them entirely for now in /proc, /dev, and /sys
if mount_point == "/":
if str(mount_point) == "/":
logger.info("Root filesystem mount seen, skipping /proc, /dev, and /sys")
async for item in mount_point.glob("*"):
if await item.is_dir():
if str(item) in IGNORE_GLOBAL:
@ -90,6 +91,7 @@ async def main(job: argparse.Namespace) -> bool:
else:
tasks.append(check_inode_and_unlink(item, inodes))
else:
logger.info(f"Checking non-root filesystem mount: {str(mount_point)}")
async for item in mount_point.rglob("*"):
if any(str(item).startswith(str(path)) for path in job.ignoredir):
continue