From 737822fd99c2b7e9a27cbaa60a85b93893ccae75 Mon Sep 17 00:00:00 2001 From: Darryl Nixon Date: Sun, 16 Jul 2023 14:01:44 -0700 Subject: [PATCH] job.paths hadn't been set yet --- melamine/shred.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/melamine/shred.py b/melamine/shred.py index 34834d7..316d04c 100644 --- a/melamine/shred.py +++ b/melamine/shred.py @@ -27,6 +27,9 @@ async def main(job: argparse.Namespace) -> bool: raise TypeError(f"Not a file or directory: {path}") new_paths = set(await asyncio.gather(*tasks)) + # Try to delete hardlinks based on the filesystem type + job.paths = await get_all_hardlinks(new_paths) + # Shred all physical files including hardlinks for path in job.paths: tasks = [] @@ -40,9 +43,6 @@ async def main(job: argparse.Namespace) -> bool: if e: logger.warning(f"Error raised while shredding: {e}") - # Try to delete hardlinks based on the filesystem type - job.paths = await get_all_hardlinks(new_paths) - # Just in case, use "find" to delete any remaining hardlinks # from the mount point, so let's build a map of inodes to mount points logger.info("Deleting remaining hardlinks using find")