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

Friendly Automation asteriskteam at digium.com
Fri Jan 22 10:35:43 CST 2021


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/testsuite/+/15360 )

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(-)

Approvals:
  Sean Bright: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



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/+/15360
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 16
Gerrit-Change-Id: I347736878eeda063a3bdb0c79cc1d727136ec2bd
Gerrit-Change-Number: 15360
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210122/2ce94e68/attachment.html>


More information about the asterisk-code-review mailing list