From 1d90c46e52190c9f8cb95fc60a7709d1431e34fb Mon Sep 17 00:00:00 2001 From: Kevin Schenk Date: Fri, 17 Jan 2025 17:24:04 -0500 Subject: [PATCH] fix: Prevent 'directory not empty' error in `snowfakery` on Linux (#3864) Implemented potential fix to address Linux issue on #3859. Please advise if any changes are requested. --------- Co-authored-by: James Estevez Co-authored-by: James Estevez Co-authored-by: Bharath Chadarajupalli --- cumulusci/tasks/bulkdata/snowfakery.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cumulusci/tasks/bulkdata/snowfakery.py b/cumulusci/tasks/bulkdata/snowfakery.py index 1125714ca0..bef4e888cf 100644 --- a/cumulusci/tasks/bulkdata/snowfakery.py +++ b/cumulusci/tasks/bulkdata/snowfakery.py @@ -583,8 +583,10 @@ def _generate_and_load_initial_batch(self, working_directory: Path): self.sets_finished_while_generating_template = num_records new_template_dir = data_loader_new_directory_name(template_dir, self.run_until) - shutil.move(template_dir, new_template_dir) - template_dir = new_template_dir + # rename only if new_template_dir does not match template_dir + if template_dir.resolve() != new_template_dir.resolve(): + shutil.move(template_dir, new_template_dir) + template_dir = new_template_dir # don't send data tables to child processes. All they # care about are ID->OID mappings