osmith submitted this change.

View Change


Approvals: fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified
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.

Gerrit-Project: python/osmo-python-tests
Gerrit-Branch: master
Gerrit-Change-Id: I41616bb27af0d8b7da124ef309cd4a6e53be6597
Gerrit-Change-Number: 36936
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-MessageType: merged