[asterisk-commits] realtime converter: Properly handle multiple values for the ... (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 5 08:22:16 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: realtime_converter: Properly handle multiple values for the same option.
......................................................................


realtime_converter: Properly handle multiple values for the same option.

Given the following:
allow=ulaw
allow=g722

The code would currently only insert the first entry for allow into
the database resulting in only ulaw being allowed.

This change fixes this by using the realtime method of separating
multiple values for the same option using ";" allowing both ulaw
and g722 to be allowed.

This is done in the realtime converter itself so this logic will
apply to any multiple values for the same option usage.

Change-Id: I5137be7947a9ad0a2856876222838b8e6cc1feaf
---
M lib/python/asterisk/realtime_converter.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/lib/python/asterisk/realtime_converter.py b/lib/python/asterisk/realtime_converter.py
index 4688f61..ca7e688 100644
--- a/lib/python/asterisk/realtime_converter.py
+++ b/lib/python/asterisk/realtime_converter.py
@@ -155,7 +155,7 @@
                 vals = {'id': title}
                 for key in section.keys():
                     if key != 'type':
-                        vals[key] = section.get(key)[0].replace(";", "^3B")
+                        vals[key] = ";".join(value.replace(";", "^3B") for value in section.get(key))
 
                 conn.execute(table.insert().values(**vals))
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5137be7947a9ad0a2856876222838b8e6cc1feaf
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-commits mailing list