[Asterisk-code-review] asterisk.py: Skip over astcachedir during directory mirroring (testsuite[18])

George Joseph asteriskteam at digium.com
Mon Jan 18 14:53:41 CST 2021


George Joseph has uploaded this change for review. ( https://gerrit.asterisk.org/c/testsuite/+/15329 )


Change subject: asterisk.py: Skip over astcachedir during directory mirroring
......................................................................

asterisk.py: Skip over astcachedir during directory mirroring

A recent change to Asterisk added the ability to specify the
media cache directory in asterisk.conf and the sample file
sets "astcachedir => /tmp".  When the testsuite iterates
over the directories in the "[directories]" category in
asterisk.conf it looks in each directory and tries to
recreate it in /tmp/asterisk-testsuite.  Since astcachedir
actually points to /tmp itself, the testsuite tries to
recursively create a directory structure.  The result
is a python crash because the pathname eventually exceeds
maximum length.

* Updated asterisk.py:_make_directory_structure to skip
  over the astcachedir entry.

Change-Id: I347736878eeda063a3bdb0c79cc1d727136ec2bd
---
M lib/python/asterisk/asterisk.py
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/29/15329/1

diff --git a/lib/python/asterisk/asterisk.py b/lib/python/asterisk/asterisk.py
index d9bb0d9..977dc6e 100644
--- a/lib/python/asterisk/asterisk.py
+++ b/lib/python/asterisk/asterisk.py
@@ -911,7 +911,8 @@
         for (var, val) in dir_cat.options:
             # We cannot simply skip ``val`` here if we already processed it.
             # Some dirs are exempt from copying, based on ``var``.
-            self.__mirror_dir(var, val, cache)
+            if var != "astcachedir":
+                self.__mirror_dir(var, val, cache)
 
         self._directory_structure_made = True
 

-- 
To view, visit https://gerrit.asterisk.org/c/testsuite/+/15329
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 18
Gerrit-Change-Id: I347736878eeda063a3bdb0c79cc1d727136ec2bd
Gerrit-Change-Number: 15329
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210118/711aa4f7/attachment.html>


More information about the asterisk-code-review mailing list