mirror of
https://github.com/ansible/awx.git
synced 2026-03-03 01:38:50 -03:30
Compensating for NUL unicode characters
NUL characters are not allowed in text fields in the database We used to strip them out of stdout but the exception changed And we want to be sure to strip them out of JSONBlob fields
This commit is contained in:
committed by
John Westcott IV
parent
7e25a694f3
commit
cd4d83acb7
@@ -191,7 +191,9 @@ class CallbackBrokerWorker(BaseWorker):
|
||||
e._retry_count = retry_count
|
||||
|
||||
# special sanitization logic for postgres treatment of NUL 0x00 char
|
||||
if (retry_count == 1) and isinstance(exc_indv, ValueError) and ("\x00" in e.stdout):
|
||||
# This used to check the class of the exception but on the postgres3 upgrade it could appear
|
||||
# as either DataError or ValueError, so now lets just try if its there.
|
||||
if (retry_count == 1) and ("\x00" in e.stdout):
|
||||
e.stdout = e.stdout.replace("\x00", "")
|
||||
|
||||
if retry_count >= self.INDIVIDUAL_EVENT_RETRIES:
|
||||
|
||||
Reference in New Issue
Block a user