[Asterisk-code-review] Avoid KeyError when astdatadir not set in asterisk.conf. (testsuite[15])

Alexander Traud asteriskteam at digium.com
Tue Jun 5 03:57:36 CDT 2018


Alexander Traud has uploaded this change for review. ( https://gerrit.asterisk.org/9092


Change subject: Avoid KeyError when astdatadir not set in asterisk.conf.
......................................................................

Avoid KeyError when astdatadir not set in asterisk.conf.

Closes asterisk/testsuite#1
ASTERISK-27894
Reported by: Jaco Kroon, Colin Sung

Change-Id: Ie5f7a78afe913567966a520ba2c87ad8af6f17f6
---
M runtests.py
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/92/9092/1

diff --git a/runtests.py b/runtests.py
index 8089387..1351a3c 100755
--- a/runtests.py
+++ b/runtests.py
@@ -65,7 +65,7 @@
 # astdatadir/third-party/pjproject directory to sys.path
 # so pjsua can be found.
 ast_config = test_suite_utils.get_asterisk_conf()
-astdatadir = ast_config.directories["astdatadir"] or '/var/lib/asterisk'
+astdatadir = ast_config.directories.get("astdatadir", '/var/lib/asterisk')
 if astdatadir[0] == os.path.sep:
      astdatadir = astdatadir[1:]
 

-- 
To view, visit https://gerrit.asterisk.org/9092
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie5f7a78afe913567966a520ba2c87ad8af6f17f6
Gerrit-Change-Number: 9092
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180605/049a67e7/attachment.html>


More information about the asterisk-code-review mailing list