1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 06:51:10 +03:00

ensure last comma removed in select

* We strip out the json select fields in our tests since it is an sql
lite database underneath. Ideally, we would do something fancier, but we
aren't. In doing this stipping, we could strip the last element in the
projection list. This would result in an extra dangling comma. This
commit removes the danging comma in the projection list after the
removal of JSON projections.
This commit is contained in:
chris meyers 2020-04-14 10:44:02 -04:00
parent f85bcae89f
commit ee18400a33

View File

@ -36,6 +36,8 @@ def sqlite_copy_expert(request):
for line in sql.split('\n'):
if line.find('main_jobevent.event_data::') == -1:
sql_new.append(line)
elif not line.endswith(','):
sql_new[-1] = sql_new[-1].rstrip(',')
sql = '\n'.join(sql_new)
self.execute(sql)