[Asterisk-code-review] Avoid KeyError when astdatadir not set in asterisk.conf. (testsuite[15.4])
Joshua Colp
asteriskteam at digium.com
Wed Jun 6 04:35:31 CDT 2018
Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/9093 )
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:
Jenkins2: Verified
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/9093
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: testsuite
Gerrit-Branch: 15.4
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie5f7a78afe913567966a520ba2c87ad8af6f17f6
Gerrit-Change-Number: 9093
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
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/74c61277/attachment.html>
More information about the asterisk-code-review
mailing list