<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/python/osmo-python-tests/+/19267">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">remove_tmpdir(): Support recursion / sub-directories<br><br>The existing code assumed that tmpdir only contained regular files,<br>not an entire hierarchy of files with sub-directories or the like.<br><br>In case sub-directories exist, the current code fails as follows:<br><br>line 176, in test_all_apps<br>    remove_tmpdir(tmpdir)<br>  File "/usr/local/lib/python3.5/dist-packages/osmopython-0.2.0-py3.5.egg/EGG-INFO/scripts/osmotestconfig.py", line 142, in remove_tmpdir<br>    os.unlink(os.path.join(tmpdir, f))<br>IsADirectoryError: [Errno 21] Is a directory: 'writtenconfig/ericsson'<br><br>Change-Id: I896b99032d94ba0cdd340a8eed7c7b625661ad69<br>---<br>M scripts/osmotestconfig.py<br>1 file changed, 2 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/scripts/osmotestconfig.py b/scripts/osmotestconfig.py</span><br><span>index 3c96ca6..8b3bb84 100755</span><br><span>--- a/scripts/osmotestconfig.py</span><br><span>+++ b/scripts/osmotestconfig.py</span><br><span>@@ -15,6 +15,7 @@</span><br><span> # along with this program.  If not, see <http://www.gnu.org/licenses/>.</span><br><span> import os</span><br><span> import os.path</span><br><span style="color: hsl(120, 100%, 40%);">+import shutil</span><br><span> import time</span><br><span> import sys, shutil, stat</span><br><span> import tempfile</span><br><span>@@ -137,10 +138,7 @@</span><br><span> </span><br><span> </span><br><span> def remove_tmpdir(tmpdir):</span><br><span style="color: hsl(0, 100%, 40%);">-    files = os.listdir(tmpdir)</span><br><span style="color: hsl(0, 100%, 40%);">-    for f in files:</span><br><span style="color: hsl(0, 100%, 40%);">-        os.unlink(os.path.join(tmpdir, f))</span><br><span style="color: hsl(0, 100%, 40%);">-    os.rmdir(tmpdir)</span><br><span style="color: hsl(120, 100%, 40%);">+    shutil.rmtree(tmpdir)</span><br><span> </span><br><span> </span><br><span> def check_configs_tested(basedir, app_configs, ignore_configs):</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/python/osmo-python-tests/+/19267">change 19267</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/python/osmo-python-tests/+/19267"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: python/osmo-python-tests </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I896b99032d94ba0cdd340a8eed7c7b625661ad69 </div>
<div style="display:none"> Gerrit-Change-Number: 19267 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>