From c55f3f292b310cb81b58033ceb879b27d23fea4c Mon Sep 17 00:00:00 2001 From: Takuya ASADA Date: Tue, 6 Oct 2020 03:45:08 +0900 Subject: [PATCH] dist/debian/debian_files_gen.py: don't ignore permission error on shutil.rmtree() shutil.rmtree(ignore_errors=True) was for ignores error when directory not exist, but it also ignores permission error, so we shouldn't use that. Run os.path.exists() before shutil.rmtree() instead. See scylladb/scylla#7337 --- dist/debian/debian_files_gen.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/debian/debian_files_gen.py b/dist/debian/debian_files_gen.py index 33785d5..44bef34 100755 --- a/dist/debian/debian_files_gen.py +++ b/dist/debian/debian_files_gen.py @@ -46,7 +46,8 @@ with open('build/SCYLLA-VERSION-FILE') as f: with open('build/SCYLLA-RELEASE-FILE') as f: release = f.read().strip() -shutil.rmtree('build/debian/debian', ignore_errors=True) +if os.path.exists('build/debian/debian'): + shutil.rmtree('build/debian/debian') shutil.copytree('dist/debian/debian', 'build/debian/debian') if product != 'scylla':