osmith submitted this change.
scripts/osmotestconfig: rmtree: no ignore_errors
Do not ignore errors with shutil.rmtree(). The script expects to be able
to delete the directory, otherwise it will fail later on. So this hides
the original error and leads to a more confusing error later on.
Change-Id: I41616bb27af0d8b7da124ef309cd4a6e53be6597
---
M scripts/osmotestconfig.py
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/scripts/osmotestconfig.py b/scripts/osmotestconfig.py
index 8840741..6580fc7 100755
--- a/scripts/osmotestconfig.py
+++ b/scripts/osmotestconfig.py
@@ -68,7 +68,8 @@
return ret
def copy_config(dirname, config):
- shutil.rmtree(dirname, True)
+ if os.path.exists(dirname):
+ shutil.rmtree(dirname)
ign = shutil.ignore_patterns('*.cfg')
shutil.copytree(os.path.dirname(config), dirname, ignore=ign)
os.chmod(dirname, stat.S_IRWXU)
To view, visit change 36936. To unsubscribe, or for help writing mail filters, visit settings.