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

Joshua Colp asteriskteam at digium.com
Wed Jun 6 04:35:16 CDT 2018


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/9094 )

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

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



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/9094
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: certified/13.21
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie5f7a78afe913567966a520ba2c87ad8af6f17f6
Gerrit-Change-Number: 9094
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180606/fe8a02a6/attachment.html>


More information about the asterisk-code-review mailing list