...
 
Commits (2)
......@@ -29,6 +29,7 @@ import pytz
import dateutil.parser
from celery.utils.log import get_task_logger
from lxml.etree import XMLSyntaxError
import re
from . import app, celery, db, redis
from ..xml import alert
......@@ -203,7 +204,7 @@ def process_heartbeat():
@celery.task(default_retry_delay=10, max_retries=None)
def process_alert(xml):
try:
xml = xml.replace('encoding="UTF-8"', '')
xml = re.sub("encoding=['\"][^'\"]*['\"]", "", xml, flags=re.IGNORECASE)
# Get the XML representation of the alert
a = alert.parseString(xml)
......